Fixed #5327 - TieredMenu: Pressing Escape-Key in submenu moves focus to first menuitem

pull/5523/head
tugcekucukoglu 2024-04-03 16:23:23 +03:00
parent 9ae9dd82b4
commit 1a68c7144e
1 changed files with 6 additions and 2 deletions

View File

@ -380,8 +380,12 @@ export default {
this.onEnterKey(event);
},
onEscapeKey(event) {
this.hide(event, true);
!this.popup && (this.focusedItemInfo.index = this.findFirstFocusedItemIndex());
if (this.focusedItemInfo.level !== 0) {
const _focusedItemInfo = this.focusedItemInfo;
this.hide(event, false);
!this.popup && (this.focusedItemInfo = { index: Number(_focusedItemInfo.parentKey.split('_')[0]), level: 0, parentKey: '' });
}
event.preventDefault();
},