Skip to content

no-redundant-roles ignores type number in input #686

Open
@andre-matulionis-ifood

Description

@andre-matulionis-ifood

Sandbox reproducing: https://codesandbox.io/s/jsx-a11y-no-redundant-role-p6ojt?file=/src/App.js

For a <input type="number"/> in the HTML, the implicit role of it is spinbutton. This happens both in Chrome 81 (image) and Firefox 76.

the print of the words "role spinbutton"

So it can be concluded that in <input type="number" role="textbox" /> the role attribute is not redundant, since it modifies the implicit role of the HTML. However the rule no-redundant-roles does not consider this.

"The element input has an implicit role of textbox. Defining this explicitly is redundant and should be avoided"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions