Skip to content

Commit a8c5aa0

Browse files
committed
fix(NcActions): close menu only on the next tick
Signed-off-by: Grigorii K. Shartsev <[email protected]>
1 parent 7b46f6d commit a8c5aa0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/NcActions/NcActions.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,11 +1249,16 @@ export default {
12491249
*/
12501250
this.$emit('open')
12511251
},
1252-
closeMenu(returnFocus = true) {
1252+
async closeMenu(returnFocus = true) {
12531253
if (!this.opened) {
12541254
return
12551255
}
12561256
1257+
// Wait for the next tick to keep the menu in DOM, allowing other components to find what button in what menu was used,
1258+
// for example, to implement auto set return focus.
1259+
// NcPopover will actually remove the menu from DOM also on the next tick.
1260+
await this.$nextTick()
1261+
12571262
this.opened = false
12581263
12591264
this.$refs.popover.clearFocusTrap({ returnFocus })

0 commit comments

Comments
 (0)