Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

JeanMeche
Copy link
Member

The aria-invalid attribute was supported but the ariaInvalid property was unknown by the schema.

fixes #63744

The `aria-invalid` attribute was supported but the `ariaInvalid` property was unknown by the schema.

fixes angular#63744
@angular-robot angular-robot bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Sep 11, 2025
@ngbot ngbot bot added this to the Backlog milestone Sep 11, 2025
@samvloeberghs
Copy link
Contributor

samvloeberghs commented Sep 12, 2025

@JeanMeche can we please add support for aria-errormessage (ariaErrormessage) as well please?
I don't see that one in the list of supported attributes.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-errormessage

Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thePunderWoman thePunderWoman dismissed samvloeberghs’s stale review September 12, 2025 15:44

Review appreciated, but is not blocking.

Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: fw-security

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: fw-security

@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Sep 12, 2025
@ngbot
Copy link

ngbot bot commented Sep 12, 2025

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "google-internal-tests" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken main, please try rebasing to main and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@JeanMeche JeanMeche requested a review from leonsenft September 12, 2025 23:04
@JeanMeche JeanMeche removed the action: merge The PR is ready for merge by the caretaker label Sep 12, 2025
@thePunderWoman thePunderWoman removed the request for review from leonsenft September 15, 2025 16:53
@thePunderWoman thePunderWoman added the action: merge The PR is ready for merge by the caretaker label Sep 15, 2025
@@ -272,7 +272,8 @@ const _ATTR_TO_PROP = new Map(
'readonly': 'readOnly',
'tabindex': 'tabIndex',

// https://www.w3.org/TR/wai-aria-1.2/#accessibilityroleandproperties-correspondence
// https://www.w3.org/TR/wai-aria-1.2/#accessibilityroleandproperteies-correspondence
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// https://www.w3.org/TR/wai-aria-1.2/#accessibilityroleandproperteies-correspondence
// https://www.w3.org/TR/wai-aria-1.2/#accessibilityroleandproperties-correspondence

@thePunderWoman thePunderWoman added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: merge The PR is ready for merge by the caretaker labels Sep 15, 2025
Copy link
Contributor

@leonsenft leonsenft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These attribute/property pairs with mismatched names (e.g. aria-controls, ariaControlsElements) break an assumption made in #62630.

#62630 made it so that Angular would always render a property whose name begins with aria as an attribute.

This was largely facilitated by the fact that one can relatively easily convert from ARIA property name to the corresponding attribute name–without needing to retain an exhaustive mapping:

function ariaAttrName(name: string): string {

These mismatched names break this assumption. Attempting to bind [ariaControlsElements]="controls" will incorrectly set the aria-controlselements attribute, when the attribute should just be aria-controls.

In summary, the resulting behavior from this change would be:

Binding Result Notes
aria-control="string" Static attribute
[attr.aria-control]="expr" Explicit attribute binding
[aria-control]="expr" Implicit attribute binding
[ariaControlsElements]="expr" Explicit property binding, this gets mapped to the incorrect property name.
[ariaControls]="expr" ⚠️ This would get mapped to the correct attribute, but isn't a valid property name.

I'm not certain yet what the best solution here is, just pointing out the problem I see at the moment.

const SCHEMA: string[] = [
'[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot' +
export const SCHEMA: string[] = [
'[Element]|textContent,%ariaActiveDescendant,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaControlsElement,%ariaCurrent,%ariaDescribedByElements,%ariaDescription,%ariaDetailsElements,%ariaDisabled,%ariaErrorMessageElements,%ariaExpanded,%ariaFlowToElements,%ariaHasPopup,%ariaHidden,%ariaInvalid,%ariaKeyShortcuts,%ariaLabel,%ariaLabelledByElements,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaOwnsElements,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'[Element]|textContent,%ariaActiveDescendant,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaControlsElement,%ariaCurrent,%ariaDescribedByElements,%ariaDescription,%ariaDetailsElements,%ariaDisabled,%ariaErrorMessageElements,%ariaExpanded,%ariaFlowToElements,%ariaHasPopup,%ariaHidden,%ariaInvalid,%ariaKeyShortcuts,%ariaLabel,%ariaLabelledByElements,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaOwnsElements,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot' +
'[Element]|textContent,%ariaActiveDescendantElement,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaControlsElement,%ariaCurrent,%ariaDescribedByElements,%ariaDescription,%ariaDetailsElements,%ariaDisabled,%ariaErrorMessageElements,%ariaExpanded,%ariaFlowToElements,%ariaHasPopup,%ariaHidden,%ariaInvalid,%ariaKeyShortcuts,%ariaLabel,%ariaLabelledByElements,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaOwnsElements,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot' +

@JeanMeche
Copy link
Member Author

We chatted offline with Leon, there needs to be some design discussion to support props that don't realy match their corresponding attribute.

We'll keep this PR a fix to support aria-invalid.

@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Sep 15, 2025
thePunderWoman pushed a commit that referenced this pull request Sep 15, 2025
The `aria-invalid` attribute was supported but the `ariaInvalid` property was unknown by the schema.

fixes #63744

PR Close #63748
@thePunderWoman
Copy link
Contributor

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

@JeanMeche JeanMeche deleted the aria-invalid branch September 15, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ergonomic syntax for aria attributes broken
6 participants