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

Blackground click is always triggered by mouse up #518

Closed
HarrisonCF opened this issue May 16, 2023 · 0 comments · Fixed by #523
Closed

Blackground click is always triggered by mouse up #518

HarrisonCF opened this issue May 16, 2023 · 0 comments · Fixed by #523
Labels
Bug Something isn't working

Comments

@HarrisonCF
Copy link

Issue: Mouse up events that end up outside of the modal area, trigger the background click to close the modal.

This can be reproduced with some highlightable text, such as in an input.
For example:
If a user highlights the text in a text input and then moves the cursor outside of the modal area while still highlighting, the mouse-up event will close the modal, interrupting what the user was working on.

Background exit should be triggered by mouse down on the background area not the modal frame, and then close when mouse up.

Solution: onmousedown, should start listening to onmouseup

gian7sm added a commit to gian7sm/Modal that referenced this issue Jun 23, 2023
Mouse click, down, and up events will be handled to avoid closing the modal by accident.
This avoids accidents when highlighting text and dragging the mouse cursor outside of the modal area (into the background).

Solves Blazored#518

This also allows the user to escape closing the modal by dragging the mouse click back into the modal content area.
chrissainty added a commit that referenced this issue Oct 2, 2023
Mouse click, down, and up events will be handled to avoid closing the modal by accident.
This avoids accidents when highlighting text and dragging the mouse cursor outside of the modal area (into the background).

Solves #518

This also allows the user to escape closing the modal by dragging the mouse click back into the modal content area.

Co-authored-by: Chris Sainty <chrissainty@users.noreply.github.com>
@chrissainty chrissainty added the Bug Something isn't working label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants