mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 17:02:38 +00:00
Fixed #5316 - MenuBar: Pressing Escape-Key in submenu moves focus to first menuitem
This commit is contained in:
parent
68741f54d5
commit
2a512606d5
1 changed files with 6 additions and 2 deletions
|
@ -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();
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue