@@ -57,7 +57,11 @@ const { height: sheetHeaderHeight } = useElementBounding(sheetHeader)
5757const { height : sheetFooterHeight } = useElementBounding (sheetFooter )
5858const { height : sheetContentHeight } = useElementBounding (sheetContent )
5959
60- const { activate, deactivate } = useFocusTrap ([sheet , backdrop ], { immediate: false })
60+ // Focus trap
61+ let focusTrap = useFocusTrap ([sheet , backdrop ], {
62+ immediate: false ,
63+ fallbackFocus : () => sheet .value || document .body ,
64+ })
6165
6266// Computed values
6367const minHeightComputed = computed (() =>
@@ -123,7 +127,7 @@ const open = () => {
123127 setTimeout (() => {
124128 if (motionValues .value .y ! .get () - 0 < 0.1 ) {
125129 emit (' opened' )
126- activate ()
130+ focusTrap . activate ()
127131 }
128132 }, props .duration )
129133 }
@@ -143,7 +147,7 @@ const close = () => {
143147 isWindowRootScrollLocked .value = false
144148
145149 if (props .blocking ) {
146- deactivate ()
150+ focusTrap . deactivate ()
147151 }
148152
149153 window .removeEventListener (' keydown' , handleEscapeKey )
@@ -452,14 +456,23 @@ defineExpose({ open, close, snapToPoint })
452456</template >
453457
454458<style scoped>
459+ [data-vsbs-container ] {
460+ position : fixed ;
461+ inset : 0px ;
462+ overflow : hidden ;
463+ pointer-events : none ;
464+ z-index : 9999 ;
465+ visibility : visible ;
466+ }
467+
455468[data-vsbs-backdrop ] {
456469 background-color : var (--vsbs-backdrop-bg , rgba (0 , 0 , 0 , 0.5 ));
457470 inset : 0 ;
458471 pointer-events : auto ;
459472 position : fixed ;
460473 user-select : none ;
461474 will-change : opacity;
462- z-index : 100 ;
475+ z-index : 1 ;
463476}
464477
465478[data-vsbs-shadow = ' true' ] {
@@ -485,7 +498,7 @@ defineExpose({ open, close, snapToPoint })
485498 visibility : hidden ;
486499 width : 100% ;
487500 will-change : height;
488- z-index : 100 ;
501+ z-index : 2 ;
489502}
490503
491504[data-vsbs-sheet-show = ' true' ] {
@@ -497,7 +510,7 @@ defineExpose({ open, close, snapToPoint })
497510 flex-shrink : 0 ;
498511 padding : 20px var (--vsbs-padding-x , 16px ) 8px ;
499512 user-select : none ;
500- z-index : 1 ;
513+ z-index : 3 ;
501514}
502515
503516[data-vsbs-header ]:before {
0 commit comments