elements with the button role must be focusable 1

elements with the button role must be focusable

// Add tabIndex={0}

 handleSelect(filter)} 
  role="button"
  tabIndex={0}
>
  {filter.name}

Here is what the above code is Doing:
1. We’re adding a tabIndex attribute to the element.
2. We’re adding a role attribute to the
element.
3. We’re adding an onClick event handler to the
element.

The tabIndex attribute tells the browser that the element is focusable.
The role attribute tells the browser that the
element is a button.
The onClick event handler tells the browser that the
element should be clickable.

Similar Posts