diff --git a/src/components/NcActions/NcActions.vue b/src/components/NcActions/NcActions.vue index 4cc89fd00b..62335be1e9 100644 --- a/src/components/NcActions/NcActions.vue +++ b/src/components/NcActions/NcActions.vue @@ -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 })