Skip to content

fix(ui5-avatar-group): remove role=button when no overflow and no hasPopup#13709

Open
NakataCode wants to merge 1 commit into
mainfrom
avatar-group-role-button
Open

fix(ui5-avatar-group): remove role=button when no overflow and no hasPopup#13709
NakataCode wants to merge 1 commit into
mainfrom
avatar-group-role-button

Conversation

@NakataCode

Copy link
Copy Markdown
Contributor

Bug Fix: Conditional ARIA Attributes for Avatar Group

Problem

type="Group" unconditionally exposed:

  • role="button"
  • tabindex="0"
  • The "Activate for complete list." aria-label suffix

...even when all avatars fit the container and there was nothing to reveal. Pressing
Enter/Space fired ui5-click with no visible effect, violating
WCAG 2.2 SC 4.1.2 (Name, Role, Value).


Solution

Introduce a _isInteractiveGroup getter that returns true only when:

  • The group has overflow (_hiddenItems > 0), or
  • accessibilityAttributes.hasPopup is set

Gate the following on this getter:

Property Behavior
_role Only set to button when interactive
_ariaLabelText suffix Only appended when interactive
_containerAriaHasPopup Only set when interactive
Event firing Only fires ui5-click when interactive

Note: The group retains tabindex="0" in all cases so it remains keyboard-discoverable.


Fixes: #13677

@NakataCode NakataCode temporarily deployed to netlify-preview June 18, 2026 08:42 — with GitHub Actions Inactive
@sap-ui5-webcomponents-release

Copy link
Copy Markdown

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.

[ui5-avatar-group]: UI5 AvatarGroup keeps role="button" and tab stop even when there are no overflow avatars to expand

1 participant