feat(ui5-list, ui5-tree): support accessible description #10131
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to: #6445
Description
This PR adds support for the
aria-describedby
and thearia-description
attribute to theui5-list
andui5-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 theui5-list
andui5-tree
components. When set, the value of this property will be used as the accessible description of the list.aria-describedby
A property
accessibleDescriptionRef
is added to theui5-list
andui5-tree
components. When set, the value of this property will be used as the id of the element that describes the list.Changes
ui5-list
andui5-tree
components now support theaccessibleDescription
andaccessibleDescriptionRef
propertiesAriaLabelHelper
was extended with a new methodsgetEffectiveAriaDescriptionText
andgetAllAccessibleDescriptionRefTexts
to handle the new properties, similar to the ones for thearia-label
attributeAccessibleTextsHelper
to better reflect its purposeui5-list
now subscribes for changes of the referenced elements using theAccessibleTextsHelper
to update thearia-description
andaria-label
attribute of the list as well theui5-tree
only forwards the values to the internalui5-tree-list
which handles the property to attribute transformation