Fixed #5054 - ContextMenu: Cache duplication "focusedItemId"
parent
261b6212f1
commit
b843bc9de3
|
@ -10,9 +10,9 @@
|
|||
:root="true"
|
||||
:tabindex="tabindex"
|
||||
aria-orientation="vertical"
|
||||
:aria-activedescendant="focused ? focusedItemId : undefined"
|
||||
:aria-activedescendant="focused ? focusedItemIdx : undefined"
|
||||
:menuId="id"
|
||||
:focusedItemId="focused ? focusedItemId : undefined"
|
||||
:focusedItemId="focused ? focusedItemIdx : undefined"
|
||||
:items="processedItems"
|
||||
:templates="$slots"
|
||||
:activeItemPath="activeItemPath"
|
||||
|
@ -309,7 +309,7 @@ export default {
|
|||
},
|
||||
onEnterKey(event) {
|
||||
if (this.focusedItemInfo.index !== -1) {
|
||||
const element = DomHandler.findSingle(this.list, `li[id="${`${this.focusedItemId}`}"]`);
|
||||
const element = DomHandler.findSingle(this.list, `li[id="${`${this.focusedItemIdx}`}"]`);
|
||||
const anchorElement = element && DomHandler.findSingle(element, 'a[data-pc-section="action"]');
|
||||
|
||||
anchorElement ? anchorElement.click() : element && element.click();
|
||||
|
@ -533,7 +533,7 @@ export default {
|
|||
}
|
||||
},
|
||||
scrollInView(index = -1) {
|
||||
const id = index !== -1 ? `${this.id}_${index}` : this.focusedItemId;
|
||||
const id = index !== -1 ? `${this.id}_${index}` : this.focusedItemIdx;
|
||||
const element = DomHandler.findSingle(this.list, `li[id="${id}"]`);
|
||||
|
||||
if (element) {
|
||||
|
@ -577,13 +577,13 @@ export default {
|
|||
|
||||
return processedItem ? processedItem.items : this.processedItems;
|
||||
},
|
||||
focusedItemId() {
|
||||
focusedItemIdx() {
|
||||
return this.focusedItemInfo.index !== -1 ? `${this.id}${ObjectUtils.isNotEmpty(this.focusedItemInfo.parentKey) ? '_' + this.focusedItemInfo.parentKey : ''}_${this.focusedItemInfo.index}` : null;
|
||||
}
|
||||
},
|
||||
components: {
|
||||
ContextMenuSub: ContextMenuSub,
|
||||
Portal: Portal
|
||||
ContextMenuSub,
|
||||
Portal
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue