Skip to content

Commit

Permalink
Issues #13568/typeerror disabled menus (#13585)
Browse files Browse the repository at this point in the history
* conditional for entirely disabled lists

* remove c.log
  • Loading branch information
jacver authored Sep 2, 2023
1 parent db3efa0 commit 79de519
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,10 @@ export class Menu implements OnDestroy {
changeFocusedOptionIndex(index) {
const links = DomHandler.find(this.containerViewChild.nativeElement, 'li[data-pc-section="menuitem"][data-p-disabled="false"]');

let order = index >= links.length ? links.length - 1 : index < 0 ? 0 : index;
order > -1 && this.focusedOptionIndex.set(links[order].getAttribute('id'));
if(links.length > 0) {
let order = index >= links.length ? links.length - 1 : index < 0 ? 0 : index;
order > -1 && this.focusedOptionIndex.set(links[order].getAttribute('id'));
}
}

itemClick(event: any) {
Expand Down

1 comment on commit 79de519

@vercel
Copy link

@vercel vercel bot commented on 79de519 Sep 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.