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

Modal unintentionally dismissed when ending a click event outside of it to highlight text #36745

Closed
3 tasks done
nickalbrecht opened this issue Jul 15, 2022 · 4 comments
Closed
3 tasks done
Labels

Comments

@nickalbrecht
Copy link

Prerequisites

Describe the issue

I'm dealing with a site I've updated from bootstrap 4.6.x to bootstrap 5.2-beta1. I'm struggling with the modal dialog because of it closing when releasing a click event outside of the dialog. Specifically anytime you are trying to click and drag to highlight text in a modal dialog to copy for use elsewhere, or highlight text in an input control to change it to something else, you have to very deliberate to not drag your mouse cursor outside of the dialog, else it will dismiss itself. Potentially losing all content/work that was in progress in the dialog (I'm loading my modal dialogs via AJAX)

Is it possible to change this behavior to only dismiss the dialog when clicking outside of the dialog, and not when ending a click event outside of it?

Alternatively is there a customization that could be done to change this behavior on an implementation basis? I know I can disable the self dismissing behavior altogether when clicking on the backdrop, but I'd prefer to keep that functionality.

Reduced test cases

https://web-platform-vlkvuc.stackblitz.io

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

5.2-beta1

@nkdas91
Copy link
Contributor

nkdas91 commented Jul 16, 2022

Maybe this is a duplicate of #36394

@GeoSot
Copy link
Member

GeoSot commented Jul 16, 2022

@nkdas91 nice catch, I think you are right

@nickalbrecht replace the boostrap script using this: https://deploy-preview-36401--twbs-bootstrap.netlify.app/docs/5.2/dist/js/bootstrap.bundle.min.js
I suppose it will work fine. If I am correct, your issue is already solved by #36401 and will be released on 5.2 stable

@GeoSot GeoSot added the js label Jul 16, 2022
@mdo
Copy link
Member

mdo commented Jul 19, 2022

Closing as duplicate for now :).

@mdo mdo closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2022
@nickalbrecht
Copy link
Author

I just updated to the release of 5.2. Can confirm that the issue appears to be fixed. Apologies, I searched for other issues when I submitted this, but somehow I missed that one.

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

No branches or pull requests

5 participants