Skip to content

Conversation

@unazko
Copy link
Contributor

@unazko unazko commented Oct 13, 2025

What Changed

Fixed the aria-label calculation in ui5-button to prioritize accessibleName over button text content when both are provided.

Why

Previously, when both text content and accessibleName were provided, the aria-label would concatenate both values, causing duplication like "Save Save" or "Submit Submit Application". This created poor accessibility experience.

What's Fixed

  • Modified the ariaLabelText getter to use conditional logic
  • When accessibleName is provided: uses only accessibleName + button type text + badge text
  • When no accessibleName: falls back to button text + button type text + badge text
  • Added comprehensive test coverage

Fixes #12398
Fixes #12442

…abel

When both text content and accessibleName are provided, the aria-label
should use only the accessibleName value plus button type text,
not concatenate both text content and accessibleName.

Fixes #12398
@ui5-webcomponents-bot
Copy link
Collaborator

ui5-webcomponents-bot commented Oct 13, 2025

🧹 Preview deployment cleaned up: https://pr-12473--ui5-webcomponents.netlify.app

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 13, 2025 08:59 Inactive
@unazko unazko requested a review from GDamyanov October 14, 2025 07:12
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 14, 2025 07:20 Inactive
Copy link
Contributor

@GDamyanov GDamyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good.
Good test coverage.

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 14, 2025 07:36 Inactive
@unazko unazko merged commit 68e6a3e into main Oct 14, 2025
14 checks passed
@unazko unazko deleted the ButtonLabel branch October 14, 2025 10:10
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 14, 2025 10:10 Inactive
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.

[Button]: button text and accessible-name are both announced by screen readers [SF][A11y][ui5-button] repetitive text in button's aria-label

4 participants