Skip to content

Commit ae25725

Browse files
authored
feat: emits animationEnd (#80)
* feat: emits animationEnd * Create thirty-singers-fry.md
1 parent 0f3215b commit ae25725

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

.changeset/thirty-singers-fry.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"vaul-vue": patch
3+
---
4+
5+
feat: emits animationEnd

packages/vaul-vue/src/DrawerRoot.vue

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
SCROLL_LOCK_TIMEOUT,
1111
useDrawer,
1212
} from './controls'
13+
import { TRANSITIONS } from './constants'
1314
1415
const props = withDefaults(defineProps<DrawerRootProps>(), {
1516
open: undefined,
@@ -52,6 +53,10 @@ const emitHandlers = {
5253
emitClose: () => emit('close'),
5354
emitOpenChange: (o: boolean) => {
5455
emit('update:open', o)
56+
57+
setTimeout(() => {
58+
emit('animationEnd', o)
59+
}, TRANSITIONS.DURATION * 1000)
5560
},
5661
}
5762

packages/vaul-vue/src/controls.ts

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export interface DrawerRootEmits {
6565
(e: 'close'): void
6666
(e: 'update:open', open: boolean): void
6767
(e: 'update:activeSnapPoint', val: string | number): void
68+
(e: 'animationEnd', open: boolean): void
6869
}
6970

7071
export interface DialogEmitHandlers {

0 commit comments

Comments
 (0)