Skip to content

Commit

Permalink
Fixed #5318 - Menu components: Hidden Menu-Item can still be activate…
Browse files Browse the repository at this point in the history
…d (focused) on Keyboard-Navigation
  • Loading branch information
tugcekucukoglu committed Apr 3, 2024
1 parent 1a68c71 commit 0c44e20
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion components/lib/contextmenu/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
},
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion components/lib/megamenu/MegaMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
},
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion components/lib/menubar/Menubar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
},
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion components/lib/tieredmenu/TieredMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
},
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0c44e20

Please sign in to comment.