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
  • Loading branch information
Amir Ashkan Baghdoust committed Nov 21, 2024
1 parent 8a04a5e commit a54d2c7
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 a54d2c7

Please sign in to comment.