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

Add missing break to prevent showing toolip on focus when on="hover" #42

Merged
merged 1 commit into from
Sep 29, 2018

Conversation

steevsachs
Copy link
Contributor

This PR adds a missing break to prevent the focus event from triggering the popup when on is set to hover.

To reproduce:
https://codesandbox.io/s/rwkqrokrro

  1. Click Trigger to give the popup element focus
  2. Minimize your browser or change to another tab
  3. Maximize or navigate back to the sandbox tab
    Result: The popup will be visible

I noticed the existing tests were using an invalid triggerOn prop instead of on, so I updated that throughout index.test.js.

I also updated the initial tests to check for rendering behavior because the shallow json snapshot could not guarantee the popup behavior in browser.

* Update tests to use `on` prop instead of `triggerOn`
* Add react-testing-library and update tests to test behavior
@steevsachs steevsachs force-pushed the bugfix/focus-event-when-on-hover branch from a0d9dc9 to af567dd Compare September 25, 2018 15:10
@yjose
Copy link
Owner

yjose commented Sep 25, 2018

good catch @steevsachs, your PR will be merged ASAP.

@yjose yjose self-requested a review September 25, 2018 15:22
@steevsachs
Copy link
Contributor Author

Awesome, @yjose, thank you for the prompt response!

Please feel free to request changes on any of those testing changes I made, particularly since I added a library. I originally tried testing with a snapshot and discovered that my snap looked like all the others and didn't prove the resolution.

@yjose
Copy link
Owner

yjose commented Sep 25, 2018

I will review the PR ASAP, and I already want to move to the react-testing-library for testing from a while now, looks interesting

Copy link
Owner

@yjose yjose left a comment

Choose a reason for hiding this comment

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

LGTM, good work

@yjose yjose merged commit 5799036 into yjose:master Sep 29, 2018
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