Merge pull request #5944 from clemvnt/patch-1

fix(ContextMenu): adjust anchor element selector to execute action on Enter key when the "item" template has been redefined
pull/6158/head^2
Tuğçe Küçükoğlu 2024-08-01 11:18:28 +03:00 committed by GitHub
commit 706e623506
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -324,7 +324,7 @@ export default {
onEnterKey(event) { onEnterKey(event) {
if (this.focusedItemInfo.index !== -1) { if (this.focusedItemInfo.index !== -1) {
const element = findSingle(this.list, `li[id="${`${this.focusedItemIdx}`}"]`); const element = findSingle(this.list, `li[id="${`${this.focusedItemIdx}`}"]`);
const anchorElement = element && findSingle(element, 'a[data-pc-section="itemlink"]'); const anchorElement = element && findSingle(element, '[data-pc-section="itemlink"]');
anchorElement ? anchorElement.click() : element && element.click(); anchorElement ? anchorElement.click() : element && element.click();
const processedItem = this.visibleItems[this.focusedItemInfo.index]; const processedItem = this.visibleItems[this.focusedItemInfo.index];