Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(tab): exclude hidden descendants #579

Merged
merged 4 commits into from
Mar 9, 2021

Conversation

ph-fritsche
Copy link
Member

What:

Exclude descendants of hidden elements.
Replaces #556

Why:

Browser does not include hidden parts of the DOM tree in tab order.

How:

Run window.getComputedStyle() for every ancestor element.
If one is hidden, exclude the element from tab order.

Checklist:

  • N/A Documentation
  • Tests
  • N/A Typings
  • Ready to be merged

Ben Styles and others added 2 commits February 11, 2021 20:23
Hidden elements should be excluded from tab order.
Hidden attribute can be overwritten by stylesheets.

There is a bug in jsdom that has to be resolved first.
See jsdom/jsdom#3111
@codecov
Copy link

codecov bot commented Mar 9, 2021

Codecov Report

Merging #579 (65bdd35) into master (31cd4cf) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #579   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          719       728    +9     
  Branches       228       232    +4     
=========================================
+ Hits           719       728    +9     
Impacted Files Coverage Δ
src/tab.js 100.00% <100.00%> (ø)
src/utils.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31cd4cf...bf73430. Read the comment docs.

@ph-fritsche ph-fritsche merged commit e83d949 into testing-library:master Mar 9, 2021
@ph-fritsche
Copy link
Member Author

@all-contributors add @benadamstyles code

@allcontributors
Copy link
Contributor

@ph-fritsche

@benadamstyles already contributed before to code

@github-actions
Copy link

github-actions bot commented Mar 9, 2021

🎉 This PR is included in version 12.8.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

This was referenced Mar 9, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant