Skip to content

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

@admrwe

Description

@admrwe

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions