Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui5-list, ui5-tree): support accessible description #10131

Merged
merged 8 commits into from
Nov 12, 2024

Conversation

dobrinyonkov
Copy link
Contributor

@dobrinyonkov dobrinyonkov commented Nov 4, 2024

Related to: #6445

Description

This PR adds support for the aria-describedby and the aria-description attribute to the ui5-list and ui5-tree components. These attributes allows developers to provide a reference to an element that describes the list or a string value, which can be read by screen readers.

Example

aria-description

A property accessibleDescription is added to the ui5-list and ui5-tree components. When set, the value of this property will be used as the accessible description of the list.

<ui5-list accessible-description="This is a list of items">...</ui5-list>

<ui5-tree accessible-description="This is a tree of items">...</ui5-tree>

aria-describedby

A property accessibleDescriptionRef is added to the ui5-list and ui5-tree components. When set, the value of this property will be used as the id of the element that describes the list.

<p id="description">This component has description</p>

<ui5-list accessible-description-ref="description">...</ui5-list>

<ui5-tree accessible-description-ref="description">...</ui5-tree>

Changes

  • ui5-list and ui5-tree components now support the accessibleDescription and accessibleDescriptionRef properties
  • An already existing utility named AriaLabelHelper was extended with a new methods getEffectiveAriaDescriptionText and getAllAccessibleDescriptionRefTexts to handle the new properties, similar to the ones for the aria-label attribute
  • the name of the utility was changed to AccessibleTextsHelper to better reflect its purpose
  • the ui5-list now subscribes for changes of the referenced elements using the AccessibleTextsHelper to update the aria-description and aria-label attribute of the list as well the
  • ui5-tree only forwards the values to the internal ui5-tree-list which handles the property to attribute transformation

@dobrinyonkov dobrinyonkov changed the title feat(ui5-list): support accessible description feat(ui5-list, ui5-tree): support accessible description Nov 5, 2024
@dobrinyonkov dobrinyonkov merged commit 45f0ffe into main Nov 12, 2024
10 checks passed
@dobrinyonkov dobrinyonkov deleted the list-acc-description branch November 12, 2024 09:33
@ui5-webcomponents-bot
Copy link
Collaborator

🎉 This PR is included in version v2.5.0-rc.0 🎉

The release is available on v2.5.0-rc.0

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants