theKashey / react-focus-lock

It is a trap! A lock for a Focus. 🔓
MIT License
1.27k stars 67 forks source link

No way to opt out of AutoFocusInside focusing tabindex=-1 elements #209

Closed cojhal closed 2 years ago

cojhal commented 2 years ago

As described in #108, there are cases where autofocusing elements with tabindex -1 is desirable, but there are other use cases for tabindex -1 where that does not make sense. For example, a composite control with a roving tab index should place focus on the active element, not necessarily the first one.

The issue can be reproduced here: https://codesandbox.io/s/react-focus-lock-tabindex-1-example-forked-371qh1. This sample works as intended if I downgrade to react-focus-lock@2.3.1.

cojhal commented 2 years ago

I accidentally submitted a duplicate, closing this one. See #210.