From 666a33c21e685f375122b83fb4f461db09c10671 Mon Sep 17 00:00:00 2001 From: Reddy Uppathi Date: Sat, 23 Nov 2024 00:41:20 +0530 Subject: [PATCH 1/2] Drawer: Add before-hide event to Drawer component --- packages/primevue/src/drawer/Drawer.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/primevue/src/drawer/Drawer.vue b/packages/primevue/src/drawer/Drawer.vue index c52e229484..e2d6f1626c 100755 --- a/packages/primevue/src/drawer/Drawer.vue +++ b/packages/primevue/src/drawer/Drawer.vue @@ -54,7 +54,7 @@ export default { name: 'Drawer', extends: BaseDrawer, inheritAttrs: false, - emits: ['update:visible', 'show', 'after-show', 'hide', 'after-hide'], + emits: ['update:visible', 'show', 'after-show', 'hide', 'after-hide', 'before-hide'], data() { return { containerVisible: this.visible @@ -113,6 +113,8 @@ export default { if (this.modal) { !this.isUnstyled && addClass(this.mask, 'p-overlay-mask-leave'); } + + this.$emit('before-hide'); }, onLeave() { this.$emit('hide'); From 01dce4c80bbde6c0daf168fd65db5e78855561f2 Mon Sep 17 00:00:00 2001 From: Reddy Uppathi Date: Sat, 23 Nov 2024 00:44:17 +0530 Subject: [PATCH 2/2] Drawer: Add before-hide event to Drawer component type --- packages/primevue/src/drawer/Drawer.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/primevue/src/drawer/Drawer.d.ts b/packages/primevue/src/drawer/Drawer.d.ts index fb44801e24..9dd62a0401 100755 --- a/packages/primevue/src/drawer/Drawer.d.ts +++ b/packages/primevue/src/drawer/Drawer.d.ts @@ -259,6 +259,10 @@ export interface DrawerEmitsOptions { * Callback to invoke when drawer is shown. */ show(): void; + /** + * Callback to invoke before drawer gets hidden. + */ + 'before-hide'(): void; /** * Callback to invoke when drawer gets hidden. */