Skip to content

Commit

Permalink
fix(NcActions): Emit close event only when the actions are fully cl…
Browse files Browse the repository at this point in the history
…osed

The flow is like:
1. Close the actions
2. `update:open` with `false` is emitted
3. Actions popover closes (transistion)
4. `close` is emitted

Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Sep 9, 2024
1 parent 099a875 commit 5bb6b1d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/components/NcActions/NcActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1448,11 +1448,6 @@ export default {
*/
this.$emit('update:open', false)

/**
* Event emitted when the popover menu is closed
*/
this.$emit('close')

// close everything
this.focusIndex = 0

Expand All @@ -1462,6 +1457,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('close')
},

/**
* Called when popover is shown after the show delay
*/
Expand Down Expand Up @@ -1922,6 +1926,7 @@ export default {
show: this.openMenu,
'apply-show': this.onOpen,
hide: this.closeMenu,
'apply-hide': this.onClosed,
},
},
[
Expand Down

0 comments on commit 5bb6b1d

Please sign in to comment.