theKashey / focus-lock

Gotcha! A11y util for scoping a focus.
MIT License
172 stars 17 forks source link

Disable focus instead of locking it inside #39

Closed benjaminrobinet closed 1 year ago

benjaminrobinet commented 2 years ago

Hello ! I have an "offscreen" menu where I want to disable focus for it while it's "closed" (not display none). And lock the focus in it when it's opened. So is there a way to de the reverse of the main goal of focus lock ? I mean allow normal focusing loop but excluding a tree ?

Thanks !

theKashey commented 2 years ago

similar to https://github.com/theKashey/react-focus-lock/issues/133

So actually "this", lets call it focus-holes, can be implemented, but there is still an open question about hiding stuff for screen readers as long as they should not see hidden content as well.

And here is the expected solution - mark "hidden"(not display none) content as aria-hidden and ensure focus-lock "jumps over it" as expected.

Let me write a test for it and see how it works. Probably it's not (yet)

stale[bot] commented 1 year ago

This issue has been marked as "stale" because there has been no activity for 2 months. If you have any new information or would like to continue the discussion, please feel free to do so. If this issue got buried among other tasks, maybe this message will reignite the conversation. Otherwise, this issue will be closed in 7 days. Thank you for your contributions so far.