Skip to content

fix(core): do not rename ARIA property bindings to attributes#63925

Closed
leonsenft wants to merge 1 commit intoangular:mainfrom
leonsenft:aria-bindings
Closed

fix(core): do not rename ARIA property bindings to attributes#63925
leonsenft wants to merge 1 commit intoangular:mainfrom
leonsenft:aria-bindings

Conversation

@leonsenft
Copy link
Copy Markdown
Contributor

@leonsenft leonsenft commented Sep 18, 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.

@leonsenft leonsenft requested a review from JeanMeche September 18, 2025 22:37
@leonsenft leonsenft added the area: core Issues related to the framework runtime label Sep 18, 2025
@ngbot ngbot bot added this to the Backlog milestone Sep 18, 2025
@leonsenft leonsenft added area: compiler Issues related to `ngc`, Angular's template compiler target: patch This PR is targeted for the next patch release labels Sep 18, 2025
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.
@JeanMeche
Copy link
Copy Markdown
Member

Since this is somehow a breaking change, do we want to target patch ?

@leonsenft leonsenft added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Sep 18, 2025
@leonsenft
Copy link
Copy Markdown
Contributor Author

Since this is somehow a breaking change, do we want to target patch ?

In a way it's fixing the breaking behavior of the last release, but I've moved it to target the next major release.

@JeanMeche
Copy link
Copy Markdown
Member

I'm actually second guessing my question. The broken behavior is only for attributes/props that we still don't support, right ?
So we could land it in patch.

@thePunderWoman thePunderWoman added the action: merge The PR is ready for merge by the caretaker label Sep 19, 2025
@thePunderWoman
Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

@leonsenft
Copy link
Copy Markdown
Contributor Author

I'm actually second guessing my question. The broken behavior is only for attributes/props that we still don't support, right ? So we could land it in patch.

You could construe this change as breaking for SSR, since something like [ariaLabel] will no longer render as an attribute and thus not be rendered by the server if DOM emulation doesn't properly reflect it (Node/domino doesn't). However this was the original behavior before #62630, so I'm skeptical this issue is anything other than hypothetical.

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler area: core Issues related to the framework runtime target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants