Why the hidden inputs? #6390
-
RAC components are typically implemented as a I'm currently evaluating which headless component library to use as the basis for my next project. I've implemented a simple radio group using both RAC and Headless UI; they seem to be functionally identical as far as pointer and keyboard interaction are concerned, but the Headless UI version seems to play a little better with VoiceOver. When I turn on VoiceOver and use [command + option + right-arrow] to navigate through the Headless UI version, it reads out the following nodes:
When I do the same with the RAC version, it reads out:
If instead of using VoiceOver's [command + option + arrow] for navigation I use just the arrow keys, it skips the groups and jumps directly from one radio button to another; this is a bit better, but then I lose the ability to inspect an option without selecting it, and the black rectangle that indicates VoiceOver focus is still drawn around a tiny region of the option instead of the whole thing. On the whole, I'm leaning towards RAC as the most feature-complete and best designed of the libraries I've looked at, but the awkward screen reader experience gives me pause. Why is it like this? Is this a quirk of VoiceOver that isn't replicated by other screen readers? Am I using it wrong? Is there a benefit to having the hidden inputs that outweighs the awkwardness of the experience? Is it just legacy architecture? Is there something else I'm missing? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Not an answer to your question but Headless UI uses |
Beta Was this translation helpful? Give feedback.
-
We back everything with native inputs so that autofill and form submission work. Side note, many assistive technologies do not have a black rectangle indicator, so I think it's ok for it to be in the general vicinity. I'm seeing it around the entire radio though in our documentation https://react-spectrum.adobe.com/react-aria/RadioGroup.html#radiogroup As for the announcements. I think Cmd + Opt + RightArrow will switch tabs in the browser. Did you mean Ctrl+Opt+RightArrow? If so, can you provide an example where it's reading off all of this? I tried it here https://react-spectrum.adobe.com/react-aria/RadioGroup.html#radiogroup but don't have anything near that level of verbosity. You might also try adjusting your verbosity in VoiceOver settings. Which browser and version are you on? |
Beta Was this translation helpful? Give feedback.
-
Linking answer to
see discussion: #5321 |
Beta Was this translation helpful? Give feedback.
With newer frameworks like Remix and Next.js Server Actions native form integration is becoming much more important again, since those rely on it.
Regardless, I don't really see this as a big issue. Sure the black box drawn by VoiceOver is a little off but that should not affect the usability of the control. There are other ways to see what you are focused on, including the focus ring you draw. I don't think it is worth supporting a completely different way of rendering controls with ARIA, which would need to be in addition to the native form support we already have, just to fix that small detail. Perhaps there are other ways we could look into this such as setting an absolute position on…