Accessibility: How to associate an input field with its label? #574
Unanswered
jacob-willden
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In order for a field in a form to be accessible, it needs to have a label associated with it (this applies to both Web and native app experiences).
I'm developing a Flutter/Dart app using
macos_uithat involves several forms with various inputs, includingMacosPopupButtonfor selecting one of several options. While I can add a label that's visually adjacent to aMacosPopupButton, I cannot figure out how to associate the label with it (I can accomplish this in Material UI usingInputDecoration(labelText)or in HTML by wrapping a<select>with a<label>).Here's a minimal reproducible example of what I've tried:
Unfortunately, wrapping the
MacosPopupButtonin theLabeldoes not associate the two, meaning the button has no accessible name. If you run the app and navigate it with a screen reader, it will only refer to the button as "button" rather than "Favorite Animal, button":macos_ui_button_no_accessible_name.mov
Is it possible to give
MacosPopupButtonan accessible name? Thanks in advance!Beta Was this translation helpful? Give feedback.
All reactions