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(click): click no longer blurs when focus changes during onClick event #208

Merged
merged 1 commit into from Jan 23, 2020

Conversation

jeffrifwald
Copy link

@jeffrifwald jeffrifwald commented Jan 9, 2020

I came across this issue while testing form components. It is common for a form to focus inputs that are invalid, and I was seeing strange behavior where I couldn't invalidate and focus the same input element twice. I did a bit of digging and see that events call blur after the click event is fired, so I believe we can fix this by checking to see if focus has already changed before calling blur.

@codecov
Copy link

codecov bot commented Jan 9, 2020

Codecov Report

Merging #208 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #208      +/-   ##
==========================================
+ Coverage   97.14%   97.18%   +0.04%     
==========================================
  Files           1        1              
  Lines         140      142       +2     
  Branches       35       33       -2     
==========================================
+ Hits          136      138       +2     
  Misses          4        4
Impacted Files Coverage Δ
src/index.js 97.18% <100%> (+0.04%) ⬆️

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 df282f9...a618fde. Read the comment docs.

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me 👍

@kentcdodds kentcdodds merged commit 4bcab8c into testing-library:master Jan 23, 2020
@kentcdodds
Copy link
Member

@all-contributors please add @jmcriffey for code and tests

@allcontributors
Copy link
Contributor

@kentcdodds

I've put up a pull request to add @jmcriffey! 🎉

@Gpx
Copy link
Member

Gpx commented Jan 23, 2020

🎉 This PR is included in version 8.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Gpx Gpx added the released label Jan 23, 2020
@benmonro
Copy link
Member

hi @jmcriffey thanks for this. hope all is well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants