-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Summary: There is a bug in the popover where tabbing out of the popover (while it is still open) will cause the focus order to be incorrect. More specifically, the focus will be returned to the trigger element, while it should be returned to the next element in the tab order. This is because the popover is not properly handling the case where the trigger element is the last element in the tab order. This PR fixes that by making all the focusable elements in the popover non-tabbable, and then make them tabbable again when the popover gains focus. For more reference on the actual error, see: https://khanacademy.atlassian.net/browse/CL-1259 https://github.com/Khan/wonder-blocks/assets/843075/ca72e266-9091-409e-9065-3754e4c681c9 Issue: WB-1638 ## Test plan: - Navigate to /?path=/story/popover-popover--keyboard-navigation - Start tabbing through the elements in the story - Verify that the focus order is correct - Open the popover - Tab through the elements in the popover and verify that the focus order is still correct - Tab backwards through the elements in the popover and verify that the focus order is still correct (using shift+tab). - Close the popover and verify that the focus order is still correct https://github.com/Khan/wonder-blocks/assets/843075/a8831575-84a8-4bb3-a0f3-11a26d872076 Author: jandrade Reviewers: lillialexis, kevinbarabash, jandrade Required Reviewers: Approved By: lillialexis, kevinbarabash Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ codecov/project, ✅ Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Test (ubuntu-latest, 20.x, 2/2), ✅ Test (ubuntu-latest, 20.x, 1/2), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⏭️ dependabot Pull Request URL: #2159
- Loading branch information
Showing
5 changed files
with
590 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@khanacademy/wonder-blocks-popover": patch | ||
--- | ||
|
||
Fix tab navigation order |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.