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(Portal): hover behavior fixed in Portal's event handlers #3257

Merged
merged 6 commits into from
Nov 7, 2018
Merged

fix(Portal): hover behavior fixed in Portal's event handlers #3257

merged 6 commits into from
Nov 7, 2018

Conversation

Fabianopb
Copy link
Member

@Fabianopb Fabianopb commented Nov 5, 2018

Originally Portal closes on mouseleave. However, mouseleave is fired when "the pointer has exited the element and all of its descendants" (ref: https://developer.mozilla.org/en-US/docs/Web/Events/mouseleave).

For that reason the Popup was closing when the pointer exited the inner elements, but not necessarily the Portal itself (which is used to render the Popup).

Gif of the fixed behavior:
popup-onmouseleave-fixed

The solution was to cancel the handlePortalMouseLeave event in case the event's target doesn't match the portal node. A test was also added. It seemed a clean enough solution for this bug, let me know what you think!

Cheers!
(fixes #3239)

@welcome
Copy link

welcome bot commented Nov 5, 2018

💖 Thanks for opening this pull request! 💖

Here is a list of things that will help get it across the finish line:

  • Run yarn lint locally to catch formatting errors. This will fix some errors automatically, commit and push any changes.
  • Run yarn test locally to catch errors. This ensures all components still behave as they should.
  • Run yarn start to run the doc site locally and try a few pages, ensuring everything is in good working order.
  • Include tests when adding/changing behavior.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@Fabianopb Fabianopb changed the title Popup hover behavior fixed in Portal's event handlers Popup hover behavior fixed in Portal's event handlers (fixes #3239) Nov 5, 2018
@Fabianopb Fabianopb changed the title Popup hover behavior fixed in Portal's event handlers (fixes #3239) Popup hover behavior fixed in Portal's event handlers Nov 5, 2018
@codecov-io
Copy link

codecov-io commented Nov 5, 2018

Codecov Report

Merging #3257 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3257      +/-   ##
==========================================
+ Coverage   99.92%   99.92%   +<.01%     
==========================================
  Files         169      169              
  Lines        2802     2803       +1     
==========================================
+ Hits         2800     2801       +1     
  Misses          2        2
Impacted Files Coverage Δ
src/addons/Portal/Portal.js 100% <100%> (ø) ⬆️

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 dfcbdd5...2a348f8. Read the comment docs.

@layershifter layershifter changed the title Popup hover behavior fixed in Portal's event handlers fix(Portal): fixed hover behavior fixed in Portal's event handlers Nov 6, 2018
@layershifter
Copy link
Member

@Fabianopb thank you for the investigation, fix looks correctly to me. I will test it on weekend.

@levithomason
Copy link
Member

Fantastic, thanks! I've updated the branch to the latest and approved it for merge. We can merge once tests pass.

@layershifter
Copy link
Member

@levithomason Codecov will never pass if you made "Update branch" on Github:

image
https://circleci.com/gh/Semantic-Org/Semantic-UI-React/6167

@Fabianopb Fabianopb changed the title fix(Portal): fixed hover behavior fixed in Portal's event handlers fix(Portal): hover behavior fixed in Portal's event handlers Nov 6, 2018
@layershifter layershifter merged commit c26ea6d into Semantic-Org:master Nov 7, 2018
@welcome
Copy link

welcome bot commented Nov 7, 2018

Congrats on merging your first pull request! 🎉🎉🎉

robot victory dance

@wangjitai
Copy link

wangjitai commented Nov 8, 2018

Hi there, Is there any idea to resolve please?

should I update the Semantic ui react version? Thanks!

@Fabianopb
Copy link
Member Author

@wangjitai the team has been cutting releases very often and last one was 19 days ago, I'd say it shouldn't take too long for the next one.

@avinashjoshi
Copy link

Exactly what i was looking for - Hopefully the new version releases soon!

@flq
Copy link

flq commented Dec 5, 2018

Any idea when this will go to npm?

@ekeren
Copy link

ekeren commented Dec 5, 2018

Hey, Any idea when this will be released as part as 0.84?

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

Successfully merging this pull request may close these issues.

Popup: hover behaviour unreliable
8 participants