-
Notifications
You must be signed in to change notification settings - Fork 83
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: link form-item label to field via aria-labelledby #3088
Conversation
24f17a0
to
2de5723
Compare
2de5723
to
b9e6427
Compare
888dd9e
to
280b7a9
Compare
I realized that the feature is not fully completed yet. In the Designer, it is possible to dynamically replace the label with a new one as well as fields can be re-arranged or replaced so that the label id should be properly unlinked in the case of the order change or the removal of a field. All this will presumably require more observers. |
2e7adcb
to
ea59696
Compare
On the other hand, this is probably not a significant problem for the user since it turns out that the form-item label accessibility can be only violated temporarily, as long as constructing a View in the Designer. Note, as a result of the Designer, there is always a static View where every field has its static place and nothing changes dynamically. From that perspective, the dynamic re-arranging of fields is probably not necessary to be supported because the feature targets only single field form-items, while supporting dynamic adding a label still seems useful. |
I agree it might bring unnecessary complexity. Let's not aim to cover all the possible edge cases. |
1b41aeb
to
69889a5
Compare
Pushed b557ead where I simplified the form-item a little bit in a way that it doesn't care anymore about cleaning the label id and |
69889a5
to
35c09de
Compare
35c09de
to
b557ead
Compare
8603566
to
ab3e4fa
Compare
ab3e4fa
to
2404be4
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Hi @vursen , this commit cannot be picked to 22.0 by this bot, can you take a look and pick it manually? |
This ticket/PR has been released with platform 23.0.0.alpha1 and is also targeting the upcoming stable 23.0.0 version. |
Description
The PR makes screen readers announce the form-item label when tabbing to the first field inside the item. This is achieved by linking the label with the field via the
aria-labelledby
attribute on:ariaTarget
property (that typically refers to a slotted input)Fixes #1145
Type of change
Checklist