WICG / inert

Polyfill for the inert attribute and property.
Other
924 stars 81 forks source link

should the _focusableElementsString include tabindex? #170

Closed michaelwarren1106 closed 3 years ago

michaelwarren1106 commented 3 years ago

Technically an element can be made focusable by adding a manual tabindex even though no one should ever really do that.

Should the _focusableElementsString contain something like

[tabindex]:not[tabindex="-1"]

?

Adobe Spectrum reference https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/focus/src/FocusScope.tsx#L152-L171

bkardell commented 3 years ago

Sorry, can I ask you to clarify the relationship? This seems to links to a different repo and I don't see 'inert' in it somewhere either...Is the question related to inert?

michaelwarren1106 commented 3 years ago

One of the good use cases of the inert feature is focus trapping. When a modal is active, for example, you might want to make all the content under the modal to be inert. The react aria package has focus trapping that has a similar functionality in “finding all the focusable elements”

alice commented 3 years ago

Whenever we use _focusableElementsString, we also check for tabindex separately.