Core: Unnecessary aria-describedby (makes #2094 fixable) #2410
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.
Apologies for the messy commit history. I squashed it (eden-jh@73a70d2) but then it forced me to merge before pushing.
Description
I added an
ariaDescribedByCleanup
option to the validator setting. The default is false just to keep the current behavior (leave the value in place but empty and hide the error elements). I don't feel strongly about that, but it felt safer to make this opt-in, especially because there's a certain amount of customization that needs to happen in order for this to be a problem.Fixes #2094 (kind of; the examples given in the issue are from unobtrusive, and the default is the current behavior, the setting will have to be updated in unobtrusive.)
Added additional tests for this functionality, plus a demo page.
Groups
aria-describedby
is used on all group elements if any of them has an error, and is only removed when all elements in that group are valid. This seemed the most consistent with the current functionality.