11import {
22 computed ,
33 getCurrentInstance ,
4- onBeforeMount ,
5- onBeforeUnmount ,
64 ref ,
75 Ref ,
86 ToRefs ,
9- toRefs ,
107 unref ,
118 VNodeProps ,
129 watch ,
@@ -24,7 +21,7 @@ import {
2421 getSelector ,
2522 TemplateRef ,
2623} from "@chakra-ui/vue-utils"
27- import { hideOthers , Undo , useInertOthers } from "@chakra-ui/vue-a11y"
24+ import { useInertOthers } from "@chakra-ui/vue-a11y"
2825import { focus , FocusableElement , isFunction } from "@chakra-ui/utils"
2926
3027export interface UseModalOptions {
@@ -99,8 +96,7 @@ export function useModal(options: UseModalOptions) {
9996 initialFocusRef,
10097 finalFocusRef,
10198 useInert,
102- blockScrollOnMount,
103- } = toRefs ( options )
99+ } = options
104100
105101 const instance = getCurrentInstance ( )
106102
@@ -301,33 +297,3 @@ export type UseModalReturn = Omit<
301297 ToRefs < ReturnType < typeof useModal > > ,
302298 "dialogRef" | "overlayRef" | "closeModal"
303299>
304-
305- /**
306- * Modal hook to polyfill `aria-modal`.
307- *
308- * It applies `aria-hidden` to elements behind the modal
309- * to indicate that they're `inert`.
310- *
311- * @param ref ref of the node to be excluded from aria-hidden
312- * @param shouldHide whether `aria-hidden` should be applied
313- */
314- export function useAriaHidden (
315- node : Ref < HTMLElement | undefined | null > ,
316- shouldHide : Ref < boolean >
317- ) {
318- let undo : Undo | null = null
319-
320- watchEffect (
321- ( ) => {
322- // await nextTick()
323- if ( shouldHide . value && node . value ) {
324- undo = hideOthers ( node . value )
325- } else {
326- undo ?.( )
327- }
328- } ,
329- {
330- flush : "post" ,
331- }
332- )
333- }
0 commit comments