-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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): change the mouse event to dismiss a modal on backdrop click #5326
fix(modal): change the mouse event to dismiss a modal on backdrop click #5326
Conversation
Because of the use of a 'click' event to trigger the dismissal of a modal, the target of the event doesn't take into account an eventual movement of the mouse before releasing click (for ex. selection of text), which can lead to unwanted dismissal of the modal. Closes: valor-software#5264
Codecov Report
@@ Coverage Diff @@
## development #5326 +/- ##
============================================
Coverage 51.54% 51.54%
============================================
Files 3 3
Lines 97 97
Branches 17 17
============================================
Hits 50 50
Misses 37 37
Partials 10 10 Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## development #5326 +/- ##
============================================
Coverage 52.52% 52.52%
============================================
Files 3 3
Lines 99 99
Branches 17 17
============================================
Hits 52 52
Misses 37 37
Partials 10 10 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix which is bugging us also. I tried to provide a review.
@florenthobein We tested your changes in our project and it didnt fix the issue in first place. I think the Directive should be fixed within this pull request also. |
How is this task going? It might fix a problem that I have. |
Because of the use of a 'click' event to trigger the dismissal of a modal, the target of the event doesn't take into account an eventual movement of the mouse before releasing click (for ex. selection of text), which can lead to unwanted dismissal of the modal.
I just pushed an updated version taking in consideration comments about variable naming & including this fix in the context of a directive. Sadly enough, there is no shared code between the Tests are OK. Any update on a potential merge? 🙏 |
Sorry for the long delay, I'm gonna review it and share with the QA team very soon |
There is something I would like to get your attention on, I have a strange behavior on my app using this patch and I'm not quite sure it's linked to this PR yet. When trying to scroll the modal using the mouse on scrollbar (drag&drop of the scrollbar), it closes the modal (verified on Chrome on a Macbook without mouse plugged). Do you reproduce this same behavior? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for contribution, looks good to me
@florenthobein well, I hope @dmitry-zhemchugov will help us to find out, is it an issue, related to this PR, or, something new, or, some special use case, which you found suddenly! |
Because of the use of a 'click' event to trigger the dismissal of a modal, the target of the event doesn't take into account an eventual movement of the mouse before releasing click (for ex. selection of text), which can lead to unwanted dismissal of the modal.
Closes: #5264
PR Checklist