Fixed #5318 - Menu components: Hidden Menu-Item can still be activated (focused) on Keyboard-Navigation

pull/5523/head
tugcekucukoglu 2024-04-03 17:06:06 +03:00
parent 1a68c7144e
commit 0c44e20402
4 changed files with 16 additions and 4 deletions

View File

@ -106,6 +106,9 @@ export default {
isItemDisabled(item) {
return this.getItemProp(item, 'disabled');
},
isItemVisible(item) {
return this.getItemProp(item, 'visible') !== false;
},
isItemGroup(item) {
return ObjectUtils.isNotEmpty(this.getItemProp(item, 'items'));
},
@ -459,7 +462,7 @@ export default {
return this.isValidItem(processedItem) && this.getProccessedItemLabel(processedItem)?.toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase());
},
isValidItem(processedItem) {
return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item);
return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item) && this.isItemVisible(processedItem.item);
},
isValidSelectedItem(processedItem) {
return this.isValidItem(processedItem) && this.isSelected(processedItem);

View File

@ -119,6 +119,9 @@ export default {
isItemDisabled(item) {
return this.getItemProp(item, 'disabled');
},
isItemVisible(item) {
return this.getItemProp(item, 'visible') !== false;
},
isItemGroup(item) {
return ObjectUtils.isNotEmpty(this.getItemProp(item, 'items'));
},
@ -515,7 +518,7 @@ export default {
return this.isValidItem(processedItem) && this.getProccessedItemLabel(processedItem)?.toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase());
},
isValidItem(processedItem) {
return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item);
return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item) && this.isItemVisible(processedItem.item);
},
isValidSelectedItem(processedItem) {
return this.isValidItem(processedItem) && this.isSelected(processedItem);

View File

@ -121,6 +121,9 @@ export default {
isItemDisabled(item) {
return this.getItemProp(item, 'disabled');
},
isItemVisible(item) {
return this.getItemProp(item, 'visible') !== false;
},
isItemGroup(item) {
return ObjectUtils.isNotEmpty(this.getItemProp(item, 'items'));
},
@ -500,7 +503,7 @@ export default {
return this.isValidItem(processedItem) && this.getProccessedItemLabel(processedItem)?.toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase());
},
isValidItem(processedItem) {
return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item);
return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item) && this.isItemVisible(processedItem.item);
},
isValidSelectedItem(processedItem) {
return this.isValidItem(processedItem) && this.isSelected(processedItem);

View File

@ -115,6 +115,9 @@ export default {
isItemDisabled(item) {
return this.getItemProp(item, 'disabled');
},
isItemVisible(item) {
return this.getItemProp(item, 'visible') !== false;
},
isItemGroup(item) {
return ObjectUtils.isNotEmpty(this.getItemProp(item, 'items'));
},
@ -493,7 +496,7 @@ export default {
return this.isValidItem(processedItem) && this.getProccessedItemLabel(processedItem)?.toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase());
},
isValidItem(processedItem) {
return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item);
return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item) && this.isItemVisible(processedItem.item);
},
isValidSelectedItem(processedItem) {
return this.isValidItem(processedItem) && this.isSelected(processedItem);