-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(material/input): do not override existing aria-describedby value #19587
fix(material/input): do not override existing aria-describedby value #19587
Conversation
5d0da4a
to
57ce77d
Compare
* Value of `aria-describedby` that should be merged with the described-by ids | ||
* which are set by the form-field. | ||
*/ | ||
readonly userAriaDescribedBy?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a bit about this to the docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that's fair. Added it to the guide and updated our custom control example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This method is used by the `<mat-form-field>` to specify the IDs that should be used for the | ||
`aria-describedby` attribute of your component. The method has one parameter, the list of IDs, we | ||
just need to apply the given IDs to our host element. | ||
This method is used by the `<mat-form-field>` to set element ids that should be used for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I think this makes it a lot more clear why both properties exist / what they're for
d8e4bc6
to
34a5f33
Compare
@devversion can you rebase when you get a chance? |
34a5f33
to
b1908a7
Compare
@jelbourn Done |
The form-field notifies controls whenever hints or errors have been displayed. It does this, so that controls like the input can refresh their `aria-describedby` value to point to the errors and hints. This currently has the downside of overriding existing `aria-describedby` values that have been manually set by developers. We could fix this by reading the initial value and merging it with the ids received from the form-field.
… value Address feedback
… value Add documentation
b1908a7
to
af8c35f
Compare
This is green now and rebased again. |
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. |
The form-field notifies controls whenever hints or errors have
been displayed. It does this, so that controls like the input
can refresh their
aria-describedby
value to point to the errorsand hints.
This currently has the downside of overriding existing
aria-describedby
values that have been manually set bydevelopers. We could fix this by reading the initial value
and merging it with the ids received from the form-field.
Fixes #19528