vuestic-ui
Version:
Vue 3 UI Framework
1 lines • 724 B
Source Map (JSON)
{"version":3,"file":"useImmediateFocus.mjs","sources":["../../../../src/composables/useImmediateFocus.ts"],"sourcesContent":["import { Ref, nextTick, watchEffect } from 'vue'\nimport { focusElement } from '../utils/focus'\nimport { unwrapEl } from '../utils/unwrapEl'\n\n/** Focus element immediately after it is rendered */\nexport const useImmediateFocus = (el: Ref<HTMLElement | undefined>) => {\n watchEffect(() => {\n if (el.value) {\n nextTick(() => {\n focusElement(unwrapEl(el.value))\n })\n }\n })\n}\n"],"names":[],"mappings":";;;AAKa,MAAA,oBAAoB,CAAC,OAAqC;AACrE,cAAY,MAAM;AAChB,QAAI,GAAG,OAAO;AACZ,eAAS,MAAM;AACA,qBAAA,SAAS,GAAG,KAAK,CAAC;AAAA,MAAA,CAChC;AAAA,IACH;AAAA,EAAA,CACD;AACH;"}