Skip to content

Commit

Permalink
fix(NcActions): close menu only on the next tick
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
  • Loading branch information
ShGKme committed Feb 6, 2024
1 parent 7b46f6d commit a8c5aa0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/NcActions/NcActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1249,11 +1249,16 @@ export default {
*/
this.$emit('open')
},
closeMenu(returnFocus = true) {
async closeMenu(returnFocus = true) {
if (!this.opened) {
return
}
// Wait for the next tick to keep the menu in DOM, allowing other components to find what button in what menu was used,
// for example, to implement auto set return focus.
// NcPopover will actually remove the menu from DOM also on the next tick.
await this.$nextTick()
this.opened = false
this.$refs.popover.clearFocusTrap({ returnFocus })
Expand Down

0 comments on commit a8c5aa0

Please sign in to comment.