Merge pull request #5323 from primefaces/issue-5316

MenuBar: Pressing Escape-Key in submenu moves focus to …
pull/5339/head
Tuğçe Küçükoğlu 2024-02-23 15:34:35 +03:00 committed by GitHub
commit 559bf63186
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

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