Skip to content

Commit

Permalink
fix(nav-item): add null check for child element before setting role t…
Browse files Browse the repository at this point in the history
…o menuitem (#2369)

Co-authored-by: Amir Ashkan Baghdoust <[email protected]>
  • Loading branch information
amir-ba and Amir Ashkan Baghdoust authored Nov 21, 2024
1 parent 8a04a5e commit 5fd16f1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class TelekomNavItem {
el.matches('a, button')
);
const parentRole = this.hostElement.parentElement?.getAttribute('role');
if (parentRole === 'menu') {
if (child && parentRole === 'menu') {
child.setAttribute('role', 'menuitem');
}
}
Expand Down

0 comments on commit 5fd16f1

Please sign in to comment.