Skip to content

4565 clear inherited aria-label on ic-navigation-button when attribute is removed#4566

Open
jb97991 wants to merge 1 commit into
mi6:developfrom
jb97991:4565-navigation-button-stale-aria-label-on-badge-hidden
Open

4565 clear inherited aria-label on ic-navigation-button when attribute is removed#4566
jb97991 wants to merge 1 commit into
mi6:developfrom
jb97991:4565-navigation-button-stale-aria-label-on-badge-hidden

Conversation

@jb97991

@jb97991 jb97991 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary of the changes

ic-navigation-button's hostMutationCallback only updated its cached inheritedAttributes when a mutated attribute's new value was truthy. This meant that when a child ic-badge cleared its parent's aria-label, the stale value was never removed from inheritedAttributes, causing the button to permanently display an outdated accessible name/tooltip.

This PR updates the callback to also delete the corresponding key from inheritedAttributes when an attribute is removed/cleared, and ensures a re-render is triggered in both cases (set and cleared), so the component correctly falls back to its own label prop once the override is gone.

Related issue

#4565

…on when attribute is removed

hostMutationCallback only updated inheritedAttributes when the new attribute value was truthy, so removing/clearing a mutable attribute (e.g. aria-label set by a child ic-badge) was never detected. This left ic-navigation-button permanently displaying a stale accessible name even after the attribute had been cleared.

Now the callback also deletes the corresponding key from inheritedAttributes and forces a re-render when the attribute is removed, so the component correctly falls back to its own label prop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant