juanca / react-aria-components

React ARIA-compliant Components
https://juanca.github.io/react-aria-components
MIT License
6 stars 3 forks source link

Grid should not be focusable #28

Open juanca opened 6 years ago

juanca commented 6 years ago

https://github.com/juanca/react-aria-components/pull/21/commits/0976d4afc058ae276828d9b0147e51367ec8715d

juanca commented 6 years ago

A little more information on this topic:

There is a ES lint rule that dictates any interactive element should also be focusable.

This makes sense. However, it defines an interactive element as any element with an event handler on click or keyboard events.

In the case for the Grid component, it is only capturing event which bubbled from some grid cell. The Grid component itself is not interactive but it is macro managing the interactions for its grid cells.

I am reading more on this and will see if there is an official work around.

juanca commented 6 years ago

It seems like the official work around is to mark the HTML element as "presentational" through a presentation role.

This doesn't work with a grid since it has the "grid" role already.

I might follow up as an issue? Or leave the lint rule disabled for that particular element.