-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Modal dialog closes when dragging and releasing mouse button outside dialog #13816
Comments
@mdo Does that sound reasonable? |
If it can be prevented in the JS, yeah, makes sense to me to address. |
fixed |
Use mousedown instead of click for backdrop click detection; fixes #13816
Modal box closing when clicked on Scroll bar (Chrome / Win 7). Able to scroll modal with mouse wheel, but can't scroll with scroll bar because of this fix. |
@surjithctly Please open a new issue. |
X-Ref: #14287. |
The fix for this has been reverted due to #14263. |
fixes #13816 Modal dialog closes when dragging and releasing mouse button outside dialog
…ng mouse button outside dialog
This is still an issue when cropping images inside non-static modals. Doing something with |
try |
Just FYI, this fix breaks scrolling on chrome when modal height is more than screen height. It's also odd, that it's usually happens on wider screen, but on smaller screen it's seems to be working just fine. Changing screen size randomly make this work, and randomly breaking. I believe this is chrome bug, as Firefox handles pointer-events and scrolling differently, and this fix works with Firefox. |
This may be relevant to finding a fix, but in my case, scrolling only breaks if the page itself lacks a scroll bar. Ie, if my page doesn't scroll, the modal won't scroll. Resizing the window by 1px to give the page a scroll bar causes scrolling to work again with the modal even though the modal still exceeds the page and window height, so it doesn't seem to actually depend on the modal height, but rather the presence of a scroll bar on the page. |
Can anyone suggest where I can set a breakpoint that will break after the triggering event has occurred, but before the modal has closed? Answering my own question: Modal.prototype.hide in bootstrap.js. Now to find the triggering event code... |
When clicking and holding the left mouse button inside a modal dialog and then dragging the mouse outside the dialog and releasing the mouse button results in the modal dialog closing.
I have a use case where you can crop an image inside a dialog and when the users drags his mouse to far and releases the mouse button the dialog closes, causing the user to restart the process.
I know I can make the backdrop static so it doesn't close when clicking on it, but this would be a last resort.
I think that the backdrop should only close if the mousedown event happened on the backdrop and not on the dialog.
The text was updated successfully, but these errors were encountered: