Skip to content
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(tab): skip elements with visibility:hidden #797

Closed
wants to merge 1 commit into from

Conversation

Dennis273
Copy link
Contributor

What:

Calling userEvent.tab focuses on element with visibility: hidden, which is not expected.

Why:
It breaks use cases related to visibility:hidden and userEvent.tab

How:

It is fixed by checking whether the target element has style visibility: hidden.

Checklist:

  • [N/A] Documentation
  • Tests
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 3, 2021

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 0d43575:

Sandbox Source
userEvent-PR-template Configuration

@codecov
Copy link

codecov bot commented Dec 6, 2021

Codecov Report

Merging #797 (0d43575) into main (57a6ea4) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #797   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           51        51           
  Lines         1005      1007    +2     
  Branches       408       405    -3     
=========================================
+ Hits          1005      1007    +2     
Impacted Files Coverage Δ
src/utils/misc/isVisible.ts 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 57a6ea4...0d43575. Read the comment docs.

@ph-fritsche ph-fritsche changed the title fix: do not focus on element with visibility:hidden when tab fix(tab): skip elements with visibility:hidden Dec 6, 2021
@ph-fritsche
Copy link
Member

Thanks a lot for your contribution ❤️

I'm not sure yet if it's worth the merge conflict with v14.0.0-beta. We'll drop support for v13 as soon as v14 is considered stable.
What do you think about targeting beta with this change?

@Dennis273
Copy link
Contributor Author

@ph-fritsche

It'll be nice if this issue can be fixed on v13 since we'll still be using v13 for a while before we can migrate to v14

I can make another PR to beta fixing this issue later this week.

@ph-fritsche
Copy link
Member

I've merged the other PR. Would you share why you expect the migration to be put on hold for a while?
We merged the remaining PRs on main before starting alpha and pushed through all breaking changes so that if the need for a fix or feature arises, anyone with that need could switch to the new version.
This change is small and the fixed code exists similarly in both branches so it might be reasonable to merge this in both. But I'm a little hesitant to even start gauging upcoming changes in that regard.

@Dennis273
Copy link
Contributor Author

🤔 We have to make tests using userEvent from syncronous to asyncronous to use v14. I was not sure whether it is worthless making those changes. But the discussion in #504 make great sense so I'm willing to do the migration as soon as v14 is released.

I'll close this PR.

@Dennis273 Dennis273 closed this Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants