File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ function handleAnimationEnd() {
178178 </script >
179179
180180<template >
181- <Sheet :open =" isOpen" @update:open =" updateOpen" >
181+ <Sheet :modal = " false " : open =" isOpen" @update:open =" updateOpen" >
182182 <SheetContent
183183 ref =" sheetContentRef"
184184 :drawer-id =" drawerId"
Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import type { DialogContentEmits , DialogContentProps } from ' reka-ui'
33import type { HTMLAttributes } from ' vue'
4- import { reactiveOmit } from ' @vueuse/core'
4+ import { reactiveOmit , useScrollLock } from ' @vueuse/core'
55import { X } from ' lucide-vue-next'
66import {
77 DialogClose ,
@@ -45,6 +45,15 @@ defineExpose({
4545})
4646
4747const showOverlay = computed (() => props .open && props .overlay )
48+ const isLocked = useScrollLock (document .body )
49+ watch (showOverlay , (val ) => {
50+ if (val ) {
51+ isLocked .value = true
52+ }
53+ else {
54+ isLocked .value = false
55+ }
56+ })
4857 </script >
4958
5059<template >
@@ -71,7 +80,7 @@ const showOverlay = computed(() => props.open && props.overlay)
7180 }"
7281 />
7382 </Transition >
74- <SheetOverlay class = " hidden " />
83+ <SheetOverlay />
7584 <DialogContent
7685 ref =" sheetContentRef"
7786 data-slot =" sheet-content"
Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import type { DialogContentEmits , DialogContentProps } from ' reka-ui'
33import type { HTMLAttributes } from ' vue'
4- import { reactiveOmit } from ' @vueuse/core'
4+ import { reactiveOmit , useScrollLock } from ' @vueuse/core'
55import { Maximize , Minimize , X } from ' lucide-vue-next'
66import {
77 DialogClose ,
@@ -47,6 +47,15 @@ defineExpose({
4747})
4848
4949const showOverlay = computed (() => props .open && props .overlay )
50+ const isLocked = useScrollLock (document .body )
51+ watch (showOverlay , (val ) => {
52+ if (val ) {
53+ isLocked .value = true
54+ }
55+ else {
56+ isLocked .value = false
57+ }
58+ })
5059 </script >
5160
5261<template >
@@ -73,7 +82,7 @@ const showOverlay = computed(() => props.open && props.overlay)
7382 }"
7483 />
7584 </Transition >
76- <DialogOverlay class = " hidden " />
85+ <DialogOverlay />
7786 <DialogContent
7887 ref =" dialogContentRef"
7988 v-bind =" forwarded"
Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ function handleAnimationEnd() {
216216 </script >
217217
218218<template >
219- <Dialog :open =" isOpen" @update:open =" updateOpen" >
219+ <Dialog :modal = " false " : open =" isOpen" @update:open =" updateOpen" >
220220 <DialogContent
221221 ref =" dialogContentRef"
222222 :modal-id =" modalId"
You can’t perform that action at this time.
0 commit comments