fix(ui5-avatar): include badge tooltip in aria-label - #13960
Conversation
|
🚀 Deployed on https://pr-13960--ui5-webcomponents-preview.netlify.app |
There was a problem hiding this comment.
Hi Yana, thanks for the fix! The initial accessible name is composed correctly, but it can become stale when the badge changes after rendering.
Updating badge.tooltip or badge.icon correctly updates the badge title and effectiveTooltip, while the Avatar root keeps its previous aria-label. Since accessibleNameText now depends on child state, the badge slot should invalidate Avatar for the relevant properties:
@slot({
type: HTMLElement,
invalidateOnChildChange: {
properties: ["icon", "tooltip", "effectiveTooltip"],
slots: false,
},
})
badge!: Slot<HTMLElement>;I verified this locally against tooltip changes, icon changes, tooltip fallback, and valid/invalid icon transitions. Could you please add this configuration and a regression test covering post-render badge updates?
For reference, I used a standalone Avatar_badge_tooltip_invalidation.html test page to reproduce and verify these cases.
kgogov
left a comment
There was a problem hiding this comment.
Requesting this small change to keep the Avatar aria-label synchronized when the badge updates.
SNOW: DINC1004809
The badge's tooltip, is added to the ui5-avatar`s aria-label, so screen readers announce the badge state.