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 (take 2) #152

Merged
merged 1 commit into from
May 11, 2022

Conversation

mvandenburgh
Copy link
Member

@mvandenburgh mvandenburgh commented May 11, 2022

@manthey this line was what broke some dialog boxes -

dialogContainer.off('click');

When jQuery's .off method only receives one argument, it removes that event listener from the element it is called on and also all of its children. So what was happening was that line was removing the click event listeners from the buttons within the dialogs too. .off takes a second argument that lets you specify a specific selector to remove the event listener from. I've done that here -

dialogContainer.off('click', '#g-dialog-container');

So now it removes the click event listener from #g-dialog-container only, and not any of its children. I tested all of the dialogs I could find in the UI with this change, and it seems to work fine.

Fixes #140

@mvandenburgh mvandenburgh requested a review from manthey May 11, 2022 14:58
@mvandenburgh mvandenburgh merged commit 051578e into master May 11, 2022
@mvandenburgh mvandenburgh deleted the close-modal-on-mousedown-fixed branch May 11, 2022 17:46
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