Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Focus root node if focusable #57
Now, useFocusTrap will traverse and find the first tabable child and focus it. Fine if thats what you want, but In my case, I want to trap the focus only. Therefore I make the container focusable—not tabable—and focus that instead.
Take an example: You want a dropdown visible if you click a button. On button click the focus should be on the dropdown as a whole, not the first element using tabIndex="-1" aria-role="list-box" aria-label="Menu" etc. But if the user tabs, the first element is read/focused and so on.
Correct! As long as root is focusable by being