Skip to content

Commit

Permalink
Fixed #3223 - Menu: TypeError with only disabled menuitems
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Nov 10, 2022
1 parent 4a9866d commit 29dc0f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/menu/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ export default {
},
changeFocusedOptionIndex(index) {
const links = DomHandler.find(this.container, 'li.p-menuitem:not(.p-disabled)');
let order = index >= links.length ? links.length - 1 : index < 0 ? 0 : index;
let order = index > links.length ? links.length - 1 : index < 0 ? 0 : index;
this.focusedOptionIndex = links[order].getAttribute('id');
order > 0 && (this.focusedOptionIndex = links[order].getAttribute('id'));
},
toggle(event) {
if (this.overlayVisible) this.hide();
Expand Down

0 comments on commit 29dc0f3

Please sign in to comment.