ember-template-lint icon indicating copy to clipboard operation
ember-template-lint copied to clipboard

Incorrect no-redundant-role warning on input

Open amk221 opened this issue 2 years ago • 2 comments

In this example:

https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-both/

An <input> has role="combobox".

ember-template-lint warns against doing this, but it seems like a valid thing to do.

amk221 avatar Mar 01 '23 22:03 amk221

QUESTION:

Does it make sense to allow the following:

<input role="combobox" />

Or should we only allow combobox role in case ARIA attributes are also present? It seems like some attributes like aria-expanded are a MUST https://w3c.github.io/aria/#combobox

samridhivig avatar Apr 18 '23 12:04 samridhivig

QUESTION:

Does it make sense to allow the following:

<input role="combobox" />

Or should we only allow combobox role in case ARIA attributes are also present? It seems like some attributes like aria-expanded are a MUST https://w3c.github.io/aria/#combobox

These types of heuristics are better served under a different rule. In this particular case, the rule is only concerned about flagging redundant roles as outline in the corresponding doc: https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-redundant-role.md.

Given that, role="combobox" being identified as an error on an input is definitely a bug, as technically, the two are not the same. FWIW, a combobox is more synonymous with the select element.

drewlee avatar May 10 '23 17:05 drewlee