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(Modal): do not close when mouse click was occurred inside #3582

Merged
merged 5 commits into from
May 5, 2019

Conversation

joergbaier
Copy link
Contributor

The default modal closes when:

  1. When a click starts in the modal but ends in the dimmer
  2. When a click starts in the dimmer but ends in the modal

This can be reproduced in the first example
https://react.semantic-ui.com/modules/modal/

This change will only close the Modal if the click starts and ends in the dimmer.

@welcome
Copy link

welcome bot commented Apr 24, 2019

💖 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.

@codecov-io
Copy link

codecov-io commented Apr 24, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3582      +/-   ##
==========================================
+ Coverage   99.81%   99.81%   +<.01%     
==========================================
  Files         174      174              
  Lines        2737     2743       +6     
==========================================
+ Hits         2732     2738       +6     
  Misses          5        5
Impacted Files Coverage Δ
src/modules/Modal/Modal.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 d6751d0...e2c7b50. Read the comment docs.

@joergbaier
Copy link
Contributor Author

It looks like #3575 could use the same change as well.

@mihai-dinculescu
Copy link
Member

mihai-dinculescu commented Apr 25, 2019

I'm not sure if changing the tests from domEvent.click to domEvent.mouseDown and domEvent.mouseUp is the right aproach. This will not hit the onClick handlers and will act differently from reality. I believe that my aproach from #3575 to update domEvent.click to also fire mousedown and mouseup is more resilient.

@joergbaier
Copy link
Contributor Author

@mihai-dinculescu I will update this PR to match yours tomorrow.

@layershifter layershifter changed the title fix(Modal): Modal closes if mouseup or mousedown inside modal fix(Modal): do not close when mouse click was occurred inside May 5, 2019
@layershifter layershifter merged commit 5af9e93 into Semantic-Org:master May 5, 2019
@welcome
Copy link

welcome bot commented May 5, 2019

Congrats on merging your first pull request! 🎉🎉🎉

robot victory dance

@fraynn
Copy link

fraynn commented May 6, 2019

Thanks for fixing this issue. Do you have any idea on when we can expect this fix to be pushed to npm ?

@layershifter
Copy link
Member

I think that we will finally make a release on this week 🎉

mbakiev pushed a commit to mbakiev/Semantic-UI-React that referenced this pull request Jun 17, 2019
…ic-Org#3582)

* Update Modal.js

* fix spec

* match Popup PR

* Update Modal.js
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.

5 participants