-
Notifications
You must be signed in to change notification settings - Fork 249
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
fix!: remove focusTrap
option
#772
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 482079e:
|
Codecov Report
@@ Coverage Diff @@
## alpha #772 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 65 64 -1
Lines 1320 1303 -17
Branches 508 504 -4
=========================================
- Hits 1320 1303 -17
Continue to review full report at Codecov.
|
🎉 This PR is included in version 14.0.0-alpha.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What:
Remove
focusTrap
option fromuserEvent.tab
Why:
The
focusTrap
option was introduced so thatuserEvent.tab
could be used with thefocus-trap-react
package. See #193If there was an issue with this, it has been resolved.
The following test passes (no codesandbox because
focus-trap-react
does not work with thejsdom
version used by codesandbox):How:
Without the option and by using the implementation in #767
userEvent.tab
could be boiled down to be a small convenience wrapper arounduserEvent.keyboard
.tab()
is equal tokeyboard('{Tab}')
tab({shift: true})
is equal tokeyboard('{Shift>}{Tab}{/Shift}')
tab({shift: false})
is equal tokeyboard('[/ShiftLeft][/ShiftRight]{Tab}')
Checklist: