Closed ZoeBijl closed 2 years ago
Been mulling this over for awhile, and did some testing with the ARIA practices codepen demo - changing the div to a button. It seems like it might be ok from a quick pass? Kind of nice actually, because then the label
can actually be associated with the button
as well. Though it would have to be used on a button with type=button
, to mitigate the possibility of the button's default submit behavior activating. But to be fair that's a stipulation that would apply to adding any role to a button.
Testing in Chromium browsers with NVDA, JAWS and Narrator, it seems ok?
Would be good to get more robust testing. @ZoeBijl can you give this a spin as well? https://codepen.io/scottohara/pen/LYjoXxX
The advantage of a button over a div would be that with Windows contrast adjustment, the drop down element would be more recognizable as an interactive element
@scottaohara
Your example does not work in Firefox (JAWS and NVDA). However, this is also true for the original WAI-ARIA Authoring Practices 1.2 example. The cause is a bug in Firefox that
But this does not speak against the suggestion of @ZoeBijl, because once the Firefox bug is fixed, it should work with div and button
Thanks for the heads up @JAWS-test. Is there presently a bug for this gap in firefox's bug tracker, that you might be aware of?
Safari and VoiceOver:
But this doesn't mean you shouldn't allow combobox on button either
thank you
With the introduction of a select only combobox (no text input), would it make sense to allow
role=combobox
on<button>
?