fix(core): do not rename ARIA property bindings to attributes#64089
Closed
JeanMeche wants to merge 1 commit intoangular:20.3.xfrom
Closed
fix(core): do not rename ARIA property bindings to attributes#64089JeanMeche wants to merge 1 commit intoangular:20.3.xfrom
JeanMeche wants to merge 1 commit intoangular:20.3.xfrom
Conversation
angular#62630 made it so that all ARIA property bindings would write to their corresponding attribute instead. The primary motivation for this change was to ensure that ARIA attributes were always rendered correctly on the server, where the emulated DOM may not correctly reflect ARIA properties as attributes. Furthermore, this change added support for binding to ARIA attributes using the property binding syntax (e.g. `[aria-label]`). Unfortunately, angular#62630 relied on the incorrect assumptions that an ARIA property name could be converted to its attribute name (without hardcoding the conversion), and that the value of an ARIA property matched its corresponding attribute. For example, the `ariaLabelledByElements` property's value is an array of DOM elements, while the corresponding `aria-labelledby` attribute's value is a string containing the IDs of the DOM elements. This partially reverts angular#62630 so that only property bindings with ARIA attribute names (begin with `aria-`) are converted to attribute bindings. * `[ariaLabel]` will revert to binding to the `ariaLabel` property. * `[aria-label]` will continue binding to the `aria-label` attribute. Note the only difference between `[aria-label]` and `[attr.aria-label]` is that the former will attempt to bind to inputs of the same name while the latter will not.
AndrewKushnir
approved these changes
Sep 25, 2025
Contributor
|
This PR was merged into the repository. The changes were merged into the following branches:
|
kirjs
pushed a commit
that referenced
this pull request
Sep 25, 2025
#62630 made it so that all ARIA property bindings would write to their corresponding attribute instead. The primary motivation for this change was to ensure that ARIA attributes were always rendered correctly on the server, where the emulated DOM may not correctly reflect ARIA properties as attributes. Furthermore, this change added support for binding to ARIA attributes using the property binding syntax (e.g. `[aria-label]`). Unfortunately, #62630 relied on the incorrect assumptions that an ARIA property name could be converted to its attribute name (without hardcoding the conversion), and that the value of an ARIA property matched its corresponding attribute. For example, the `ariaLabelledByElements` property's value is an array of DOM elements, while the corresponding `aria-labelledby` attribute's value is a string containing the IDs of the DOM elements. This partially reverts #62630 so that only property bindings with ARIA attribute names (begin with `aria-`) are converted to attribute bindings. * `[ariaLabel]` will revert to binding to the `ariaLabel` property. * `[aria-label]` will continue binding to the `aria-label` attribute. Note the only difference between `[aria-label]` and `[attr.aria-label]` is that the former will attempt to bind to inputs of the same name while the latter will not. PR Close #64089
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Patch port of #63925
#62630 made it so that all ARIA
property bindings would write to their corresponding attribute instead. The primary motivation for this change was to ensure that ARIA attributes were always rendered correctly on the server, where the emulated DOM may not correctly reflect ARIA properties as attributes. Furthermore, this change added support for binding to ARIA attributes using the property binding syntax (e.g.
[aria-label]).Unfortunately, #62630 relied on
the incorrect assumptions that an ARIA property name could be converted to its attribute name (without hardcoding the conversion), and that the value of an ARIA property matched its corresponding attribute. For example, the
ariaLabelledByElementsproperty's value is an array of DOM elements, while the correspondingaria-labelledbyattribute's value is a string containing the IDs of the DOM elements.This partially reverts #62630 so
that only property bindings with ARIA attribute names (begin with
aria-) are converted to attribute bindings.[ariaLabel]will revert to binding to theariaLabelproperty.[aria-label]will continue binding to thearia-labelattribute.