@@ -108,8 +108,6 @@ const open = () => {
108108 duration: props .duration ,
109109 })
110110 showSheet .value = true
111- isWindowScrollLocked .value = true
112- isWindowRootScrollLocked .value = true
113111
114112 window .addEventListener (' keydown' , handleEscapeKey )
115113
@@ -133,8 +131,6 @@ const close = () => {
133131 })
134132
135133 showSheet .value = false
136- isWindowScrollLocked .value = false
137- isWindowRootScrollLocked .value = false
138134
139135 if (props .blocking ) {
140136 focusTrap .deactivate ()
@@ -211,7 +207,8 @@ const handleDrag: Handler<'drag', PointerEvent> | undefined = ({
211207}
212208
213209const handleDragEnd: Handler <' drag' , PointerEvent > | undefined = () => {
214- if (! sheet .value ) return
210+ isWindowScrollLocked .value = false
211+ isWindowRootScrollLocked .value = false
215212
216213 translateY .value = props .canSwipeClose
217214 ? [0 , height .value ].reduce ((prev , curr ) =>
@@ -240,6 +237,9 @@ const handleDragEnd: Handler<'drag', PointerEvent> | undefined = () => {
240237}
241238
242239const handleDragStart = () => {
240+ isWindowScrollLocked .value = true
241+ isWindowRootScrollLocked .value = true
242+
243243 height .value = sheetHeight .value
244244 translateY .value = motionValues .value .y ! .get ()
245245 stopMotion ()
@@ -272,6 +272,9 @@ useGesture(
272272useGesture (
273273 {
274274 onDragStart : ({ direction : [_directionX , _directionY ] }) => {
275+ isWindowScrollLocked .value = true
276+ isWindowRootScrollLocked .value = true
277+
275278 height .value = sheetHeight .value
276279 translateY .value = motionValues .value .y ! .get ()
277280 stopMotion ()
0 commit comments