Skip to content

Commit 1fee90f

Browse files
committed
chore: fix build error
1 parent bf25589 commit 1fee90f

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

Diff for: packages/vaul-vue/src/DrawerContent.vue

+4-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const snapPointHeight = computed(() => {
1515
return '0'
1616
})
1717
18-
const handlePointerDownOutside = (event: PointerEvent) => {
18+
const handlePointerDownOutside = (event: Event) => {
1919
if (!dismissible.value && dismissible.value !== undefined) {
2020
event.preventDefault()
2121
return
@@ -35,16 +35,9 @@ watch(
3535
</script>
3636

3737
<template>
38-
<DialogContent
39-
vaul-drawer=""
40-
:vaul-drawer-visible="isVisible ? 'true' : 'false'"
41-
ref="drawerRef"
42-
:style="[attrs.style, { '--snap-point-height': snapPointHeight }]"
43-
@pointerdown="onPress"
44-
@pointermove="onDrag"
45-
@pointerup="onRelease"
46-
@pointer-down-outside="handlePointerDownOutside"
47-
>
38+
<DialogContent vaul-drawer="" :vaul-drawer-visible="isVisible ? 'true' : 'false'" ref="drawerRef"
39+
:style="[attrs.style, { '--snap-point-height': snapPointHeight }]" @pointerdown="onPress" @pointermove="onDrag"
40+
@pointerup="onRelease" @pointer-down-outside="handlePointerDownOutside">
4841
<slot />
4942
</DialogContent>
5043
</template>

Diff for: packages/vaul-vue/src/controls.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function useDrawer(): DrawerRootContext {
8282
const dismissible = ref(true)
8383
const shouldScaleBackground = ref(false)
8484
const justReleased = ref(false)
85-
const nestedOpenChangeTimer = ref<NodeJS.Timeout | null>(null)
85+
const nestedOpenChangeTimer = ref<number | null>(null)
8686
const nested = ref(false)
8787

8888
const onCloseProp = ref<(() => void) | undefined>(undefined)
@@ -203,12 +203,12 @@ export function useDrawer(): DrawerRootContext {
203203
isDragging.value = true
204204
dragStartTime.value = new Date()
205205

206-
// iOS doesn't trigger mouseUp after scrolling so we need to listen to touched in order to disallow dragging
207-
// if (isIOS()) {
208-
// window.addEventListener('touchend', () => (isAllowedToDrag.value = false), { once: true });
209-
// }
210-
// Ensure we maintain correct pointer capture even when going outside of the drawer
211-
;(event.target as HTMLElement).setPointerCapture(event.pointerId)
206+
// iOS doesn't trigger mouseUp after scrolling so we need to listen to touched in order to disallow dragging
207+
// if (isIOS()) {
208+
// window.addEventListener('touchend', () => (isAllowedToDrag.value = false), { once: true });
209+
// }
210+
// Ensure we maintain correct pointer capture even when going outside of the drawer
211+
; (event.target as HTMLElement).setPointerCapture(event.pointerId)
212212
pointerStartY.value = event.screenY
213213
}
214214

@@ -355,11 +355,11 @@ export function useDrawer(): DrawerRootContext {
355355
scaleBackground(false)
356356

357357
isVisible.value = false
358-
setTimeout(() => {
358+
window.setTimeout(() => {
359359
isOpen.value = false
360360
}, 300)
361361

362-
setTimeout(() => {
362+
window.setTimeout(() => {
363363
if (snapPoints.value) {
364364
activeSnapPoint.value = snapPoints.value[0]
365365
}
@@ -391,7 +391,7 @@ export function useDrawer(): DrawerRootContext {
391391
// `justReleased` is needed to prevent the drawer from focusing on an input when the drag ends, as it's not the intent most of the time.
392392
justReleased.value = true
393393

394-
setTimeout(() => {
394+
window.setTimeout(() => {
395395
justReleased.value = false
396396
}, 200)
397397
}
@@ -493,7 +493,7 @@ export function useDrawer(): DrawerRootContext {
493493
})
494494

495495
if (!o && drawerRef.value?.$el) {
496-
nestedOpenChangeTimer.value = setTimeout(() => {
496+
nestedOpenChangeTimer.value = window.setTimeout(() => {
497497
set(drawerRef.value?.$el, {
498498
transition: 'none',
499499
transform: `translate3d(0, ${getTranslateY(drawerRef.value?.$el as HTMLElement)}px, 0)`

0 commit comments

Comments
 (0)