-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add IterateFocusableElements options to focusZone #235
Conversation
🦋 Changeset detectedLatest commit: 00478de The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
<button>Peach</button> | ||
</div> | ||
</div> | ||
<button tabIndex={-1}>Cantaloupe</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing something. Doesn't this make it non focusable with keyboard? How does this button have a place in the focusable
array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The iterateFocusableElements
will return "any element with tabindex
explicitly set can be focusable, even if it's set to "-1"" if onlyTabbable
option is false
Background:
We ran into a bug when using
useFocusZone
in our component where when the css visibility is set to "hidden" the user is unable to tab past the element. I noticediterateFocusableElements
has astrict
option that checks for elements with hidden visibility butuseFocusZone
does not support thestrict
argument to be passed through toiterateFocusableElements
. We would like to enable strict mode inuseFocusZone
to removevisibility: hidden
elements as focusable elements.More details on the bug: https://github.com/github/issues/issues/7911
What are you trying to accomplish?
Add ability in focus zone to pass through settings options to
iterateFocusableElements
. Also, I added an additional check to not focus on elements that have "display: none" on the element and its parents