-
Notifications
You must be signed in to change notification settings - Fork 58
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: tabbable sometimes incorrectly includes children of a web component #681
fix: tabbable sometimes incorrectly includes children of a web component #681
Conversation
🦋 Changeset detectedLatest commit: ec56737 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 |
👀 |
Codecov Report
@@ Coverage Diff @@
## master #681 +/- ##
==========================================
+ Coverage 97.66% 97.72% +0.06%
==========================================
Files 1 1
Lines 214 220 +6
Branches 104 106 +2
==========================================
+ Hits 209 215 +6
Misses 5 5
Continue to review full report at Codecov.
|
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.
A very proactive PR, ticking all the boxes. 😄 Thank you! I do have a couple of requests/concerns, though.
1876143
to
9c77493
Compare
6e2f4ea
to
9e64441
Compare
9e64441
to
ec56737
Compare
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.
Thanks for the updates, and for tweaking the comment in the code about what is and is not tabbable to be more generic so there's no confusion in the future about shadows with 1 vs multiple children.
Looks good!
@stefcameron No problem 🙇 How long do you think until this gets released and updated in focus-trap? Not rushing just need to update my ticket ~ |
I'll release tabbable as soon as I merge this, and then will do a release of focus-trap. So you should see a new version of focus-trap out later today or tomorrow. |
Getting published to |
|
Use Case
A browser will skip tab-targeting an element if it is the only child of a web component which has a tabindex of -1.
Example
Expected behaviour
tabbable()
should return an empty list for the example aboveActual behaviour
tabbable()
returns a list which includes the input depicted aboveImpact
This bug can cause a focus-trap to behave erratically when nearing the end of focusable elements.
PR Checklist
Please leave this checklist in your PR.
typeof document/window !== 'undefined'
before using it in code that gets executed on load.yarn changeset
locally to add one, and follow the prompts).