Skip to content
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

Button with type="button" doesn't support role="combobox" #1713

Open
admrwe opened this issue Apr 17, 2024 · 0 comments
Open

Button with type="button" doesn't support role="combobox" #1713

admrwe opened this issue Apr 17, 2024 · 0 comments

Comments

@admrwe
Copy link

admrwe commented Apr 17, 2024

In a 2022 PR to html-aria (w3c/html-aria#396) it appears the the button element was updated to accept a role="combobox", and the same change was made to the validator (#1301). However, I am still seeing parsing errors throw when role="combobox" is added to a button using type="button".

For example, this is invalid:

<button type="button" role="combobox" aria-expanded="false">Foo</button>

Throwing this error:

Error: Bad value button for attribute type on element [button](https://html.spec.whatwg.org/multipage/#the-button-element).

However, this is valid:

<button role="combobox" aria-expanded="false">Foo</button>

Was this an oversight in the previous change? I don't believe it makes sense for role="combobox" to only be valid on a button using the implicit type="submit", since I would think that in a combobox pattern you would explicitly not want a button to submit its parent form, since the job of a button role="combobox" is to control its associated popup element.

Am I overlooking something? Or is this an additional improvement that could be made to the aria spec and the validator to support valid use cases of a combobox button?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants