Skip to content

Conversation

@sarahbrng
Copy link
Contributor

@sarahbrng sarahbrng commented Dec 11, 2025

Proposed changes

Das Problem: Bisher wurden ARIA-Labels beim Laden der Komponente einmalig gesetzt ("Snapshotted"). Bei dynamischen Änderungen zur Laufzeit (z. B. Sprachwechsel via i18n) blieb der Screenreader-Text veraltet.

Die Lösung: Die Inputs ariaLabel und ariaLabelledBy sind nun reaktive Props somit werden Änderungen sofort an das innere input[type="checkbox"] weitergegeben. Der Accessible Name ist immer live aktuell.

aria-label bindet an ariaLabel.

aria-labelledby bindet an ariaLabelledBy.

resolves #5495

Types of changes

  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improvements to existing components or architectural decisions)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Further comments

🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/5495-changing-language-with-aria-labels-not-correctly-applied-to-elements

@changeset-bot
Copy link

changeset-bot bot commented Dec 11, 2025

⚠️ No Changeset found

Latest commit: c351db1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sarahbrng sarahbrng moved this from 🏗 In progress to 🎁 Ready for review in UX Engineering Team Backlog Dec 11, 2025
github-actions bot and others added 2 commits December 11, 2025 10:55
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the 📺showcases Changes to 1-n showcases label Dec 12, 2025
github-actions bot and others added 5 commits December 12, 2025 10:45
github-actions bot and others added 2 commits December 12, 2025 12:51
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@mfranzke
Copy link
Collaborator

mfranzke commented Dec 13, 2025

@sarahbrng only making some of those aria-*-HTML-attribute reactive to changes might not be intuitive to the developers. I would have assumed that the existing mechanism for pass-throughs of those attributes even already takes care of this stuff, elsewhere we should optimize that functionality from my point of view, as this missing functionality would be expected equally at other attributes as well.

github-actions bot and others added 2 commits December 15, 2025 07:43
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@michaelmkraus michaelmkraus removed their assignment Dec 15, 2025
@michaelmkraus michaelmkraus moved this from 👀 Actively In Review to 🎶 Waiting for feedback in UX Engineering Team Backlog Dec 15, 2025
github-actions bot and others added 3 commits December 15, 2025 10:11
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…pplied-to-elements' of https://github.com/db-ux-design-system/core-web into 5495-changing-language-with-aria-labels-not-correctly-applied-to-elements
github-actions bot and others added 2 commits December 15, 2025 11:38
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot and others added 4 commits December 15, 2025 14:09
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…pplied-to-elements' of https://github.com/db-ux-design-system/core-web into 5495-changing-language-with-aria-labels-not-correctly-applied-to-elements
github-actions bot and others added 3 commits December 15, 2025 15:48
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…licts

The onMount hook in switch.lite.tsx was using state._id immediately after
setting it to construct derived IDs (_labelId, _messageId, etc.). In React,
this compiled to useState setters which don't update values synchronously,
causing all derived IDs to be based on undefined/_id instead of the new ID value.

This resulted in all switches on a page sharing the same broken label IDs,
making screen readers announce the first switch's label for all switches.

Fix: Use a local const variable to hold the ID value, ensuring all derived
IDs are correctly constructed from the same value in a single pass.

Fixes rendering bug introduced in commit 040e72a which added aria-labelledby support.
github-actions bot and others added 4 commits December 16, 2025 12:12
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…licts

The onMount hook in switch.lite.tsx was using state._id immediately after
setting it to construct derived IDs (_labelId, _messageId, etc.). In React,
this compiled to useState setters which don't update values synchronously,
causing all derived IDs to be based on undefined/_id instead of the new ID value.

This resulted in all switches on a page sharing the same broken label IDs,
making screen readers announce the first switch's label for all switches.

Fix: Use a local const variable to hold the ID value, ensuring all derived
IDs are correctly constructed from the same value in a single pass.

Fixes rendering bug introduced in commit 040e72a which added aria-labelledby support.
…pplied-to-elements' of https://github.com/db-ux-design-system/core-web into 5495-changing-language-with-aria-labels-not-correctly-applied-to-elements
@github-project-automation github-project-automation bot moved this from 🎶 Waiting for feedback to ⏰ready for release in UX Engineering Team Backlog Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏘components 📺showcases Changes to 1-n showcases

Projects

Status: ⏰ready for release

Development

Successfully merging this pull request may close these issues.

Changing language with aria-labels not correctly applied to elements

4 participants