Skip to content

Commit

Permalink
feat(NcActions): Emit closed event when the actions are fully closed
Browse files Browse the repository at this point in the history
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 <opensource@fthiessen.de>
  • Loading branch information
susnux committed Sep 16, 2024
1 parent 8f127aa commit f17f588
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/components/NcActions/NcActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1449,9 +1449,10 @@ 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')
this.$emit('close')
// close everything
this.focusIndex = 0
Expand All @@ -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
*/
Expand Down Expand Up @@ -1922,6 +1932,7 @@ export default {
show: this.openMenu,
'apply-show': this.onOpen,
hide: this.closeMenu,
'apply-hide': this.onClosed,
},
},
[
Expand Down

0 comments on commit f17f588

Please sign in to comment.