From 2a512606d50a657af513b4306cc0ae858c912c85 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Thu, 22 Feb 2024 15:58:31 +0300 Subject: [PATCH] Fixed #5316 - MenuBar: Pressing Escape-Key in submenu moves focus to first menuitem --- components/lib/menubar/Menubar.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/lib/menubar/Menubar.vue b/components/lib/menubar/Menubar.vue index b09e1f966..f796a896c 100755 --- a/components/lib/menubar/Menubar.vue +++ b/components/lib/menubar/Menubar.vue @@ -417,8 +417,12 @@ export default { this.onEnterKey(event); }, onEscapeKey(event) { - this.hide(event, true); - this.focusedItemInfo.index = this.findFirstFocusedItemIndex(); + if (this.focusedItemInfo.level !== 0) { + const _focusedItemInfo = this.focusedItemInfo; + + this.hide(event, false); + this.focusedItemInfo = { index: Number(_focusedItemInfo.parentKey[0]), level: 0, parentKey: '' }; + } event.preventDefault(); },