Answers for "interactive role must be focusable"

0

interactive role must be focusable

<a 
  onClick={() => handleSelect(filter)} 
  role="button"
  tabIndex={0}
>
  {filter.name}
</a>
Posted by: Guest on July-02-2021
0

interactive role must be focusable

Buttons are interactive controls and thus focusable. If the button role is added to an element
that is not focusable by itself (such as <span>, <div> or <p>) then, the tabindex attribute has
to be used to make the button focusable.

<a 
  onClick={() => handleSelect(filter)} 
  role="button"
  tabIndex={0}
>
  {filter.name}
</a>

The HTML attribute tabindex corresponds to the attribute tabIndex in React.
Posted by: Guest on July-02-2021

Code answers related to "interactive role must be focusable"

Browse Popular Code Answers by Language