From c7296948cdde6787f72ea531cb364a1004b5ac53 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 9 Sep 2024 15:24:19 +0200 Subject: [PATCH] feat(NcActions): Emit `closed` event when the actions are fully closed The flow is like: 1. Close the actions 2. `update:open` with `false` is emitted (+ deprecated 'close' event) 3. Actions popover closes (transistion) 4. `closed` is emitted Signed-off-by: Ferdinand Thiessen --- src/components/NcActions/NcActions.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/NcActions/NcActions.vue b/src/components/NcActions/NcActions.vue index 1a9406275a..dabad14826 100644 --- a/src/components/NcActions/NcActions.vue +++ b/src/components/NcActions/NcActions.vue @@ -1449,7 +1449,8 @@ export default { this.$emit('update:open', false) /** - * Event emitted when the popover menu is closed + * Event emitted when the popover menu is *being* closed. + * @deprecated use `update:open` instead. This is always emitted the same time as `('update:open', false)` */ this.$emit('close') @@ -1462,6 +1463,15 @@ export default { } }, + onClosed() { + /** + * Event emitted when the popover menu is closed. + * + * This event is emitted after `update:open` was emitted and the closing transition finished. + */ + this.$emit('closed') + }, + /** * Called when popover is shown after the show delay */ @@ -1922,6 +1932,7 @@ export default { show: this.openMenu, 'apply-show': this.onOpen, hide: this.closeMenu, + 'apply-hide': this.onClosed, }, }, [