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

Don't close dialog when dragging outside of it #149

Merged
merged 2 commits into from
May 9, 2022

Conversation

mvandenburgh
Copy link
Member

This PR changes the behavior of the Bootstrap modal component to automatically close on mousedown instead of on click.
The latter is the default behavior of Bootstrap, so I attached a new event listener to accomplish this - see code comments for details.

Fixes #140

@mvandenburgh mvandenburgh requested a review from manthey May 6, 2022 18:20
@manthey
Copy link
Contributor

manthey commented May 6, 2022

Great.

How much work would it be to change this behavior for all dialogs when we have the HistomicsUI plugin present? Would you prefer to merge this and then generalize the behavior or modify this PR to generalize it?

@mvandenburgh
Copy link
Member Author

Great.

How much work would it be to change this behavior for all dialogs when we have the HistomicsUI plugin present? Would you prefer to merge this and then generalize the behavior or modify this PR to generalize it?

I don't think it would be too much work, I can modify this PR to generalize it.

@mvandenburgh
Copy link
Member Author

@manthey I generalized the mousedown behavior for all dialogs with an id of #g-dialog-container. Alternatively we could use .modal, which would apply this behavior to any Bootstrap modal, but without knowing more about how Girder 3's styling works, I went with the more limited scope - let me know if the latter would make more sense

@manthey
Copy link
Contributor

manthey commented May 9, 2022

@manthey I generalized the mousedown behavior for all dialogs with an id of #g-dialog-container. Alternatively we could use .modal, which would apply this behavior to any Bootstrap modal, but without knowing more about how Girder 3's styling works, I went with the more limited scope - let me know if the latter would make more sense

Great -- if one of the users asked for it to apply to Girder dialogs, we'll handle it then.

@mvandenburgh mvandenburgh merged commit 38ef091 into master May 9, 2022
@mvandenburgh mvandenburgh deleted the close-modal-on-mousedown branch May 9, 2022 16:30
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.

Dragging outside of a dialog makes it close
2 participants