Skip to content

Commit

Permalink
fix: not open immediately, linting
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed Feb 27, 2024
1 parent cfa6604 commit a058285
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
18 changes: 12 additions & 6 deletions packages/vaul-vue/src/DrawerContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,28 @@ function handlePointerDownOutside(event: Event) {
}
watch(
() => isOpen.value,
(isOpen) => {
if (isOpen) {
isOpen,
(open) => {
if (open) {
setTimeout(() => {
isVisible.value = true
}, 1)
}
},
{ immediate: true },
)
</script>

<template>
<DialogContent
ref="drawerRef" vaul-drawer="" :vaul-drawer-visible="isVisible ? 'true' : 'false'"
:style="[attrs.style, { '--snap-point-height': snapPointHeight }]" @pointerdown="onPress" @pointermove="onDrag"
@pointerup="onRelease" @pointer-down-outside="handlePointerDownOutside"
ref="drawerRef"
vaul-drawer=""
:vaul-drawer-visible="isVisible ? 'true' : 'false'"
:style="[attrs.style, { '--snap-point-height': snapPointHeight }]"
@pointerdown="onPress"
@pointermove="onDrag"
@pointerup="onRelease"
@pointer-down-outside="handlePointerDownOutside"
>
<slot />
</DialogContent>
Expand Down
7 changes: 5 additions & 2 deletions packages/vaul-vue/src/DrawerRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ function handleOpenChange(o: boolean) {
</script>

<template>
<DialogRoot :open="open" :modal="modal" @update:open="handleOpenChange">
<DialogRoot
:open="open"
:modal="modal"
@update:open="handleOpenChange"
>
<slot />
</DialogRoot>
</template>
Expand Down Expand Up @@ -120,7 +124,6 @@ function handleOpenChange(o: boolean) {
/* This will allow us to not animate via animation, but still benefit from delaying unmount via Radix. */
@keyframes fake-animation {
from {}
to {}
}
Expand Down

0 comments on commit a058285

Please sign in to comment.