-
-
Notifications
You must be signed in to change notification settings - Fork 777
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 issue with multiple tooltips showing #256
Conversation
sorry, i may not understand correctly about your problem. I took a look at your codepen demo, and multiple tooltips will be shown is because that the two handle is very closely, so they both trigger |
The bug is that the tooltips don't disappear. See this GIF: https://media.giphy.com/media/3o7bucOydJQsjY6UwM/giphy.gif Pretty sure this is an issue with onMouseLeave setState not being atomic (has old state values because it's fired before first setState has been applied). |
@gragland CI is broken, try upgrade enzyme to latest. |
@paranoidjk Looks like it failed because coverage decreased. Is that the case? I can write a few tests for createSliderWithTooltip if so. |
Add test case about your fix. |
I'd like to say, it's because multiple |
ping~ @gragland |
@gragland I will handle the test case. |
add test at 756dcc8 |
This fixes an issue with
createSliderWithTooltip()
where multiple tooltips will be shown at once if the mouse is dragged over two or more handles quickly.Reproduced here:
http://codepen.io/anon/pen/jmEPxV?editors=0011
This was due to the fact that multiple setStates would fire back to back and the second would apply old state values. Passing a function to setState (atomic update) was the fix.