Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Dialog close button needs dialog-button class #5559

Closed
wants to merge 2 commits into from

Conversation

redmunds
Copy link
Contributor

This is for #5558

cc @WebsiteDeveloper

@redmunds
Copy link
Contributor Author

@peterflynn Can you review?

@WebsiteDeveloper
Copy link
Contributor

@redmunds change looks good

@RaymondLim
Copy link
Contributor

@redmunds
Is this the only way to fix? I asked because I saw lots of extensions that pop a dialog are not using "dialog-button" class. So those extensions can cause Brackets to freeze even if your fix lands in master.

@peterflynn
Copy link
Member

@redmunds I wonder if it'd be a more robust fix to change Dialogs to listen for .close in addition to .dialog-button? Most dialog boxes have a close button in their template, so that seems simpler than chasing down every dialog template (including some in extensions, probably) and adding this new CSS class to all of them.

If we're worried about false positives if dialogs use .close to mean something else (granted, probably unlikely), then we could make the selector something something more specific like .modal-header > .close.

@peterflynn
Copy link
Member

Otoh, how is the close button even able to dismiss the dialog in the first place? It seems like it's removing the dialog without calling _dismissDialog()... but what is it calling then? Does Bootstrap have its own listener just for close buttons??

@WebsiteDeveloper
Copy link
Contributor

@peterflynn i investigated this a bit further.
Bootstrap does indeed have its own handling code for clicks on the close button. its actually calling the
hide method of the bootstrap modal which just removes the modal itself and not the modal wrapper.
As pointed out we could remove the handler in bootstrap and add the .close button handler in Dialogs.js

@WebsiteDeveloper
Copy link
Contributor

If wanted i can put up a pull

@peterflynn
Copy link
Member

@WebsiteDeveloper Thanks for investigating! Would it harm anything to leave the Bootstrap listener in place, but also listen in Dialogs.js? I think some people on the team would like us to avoid modifying Bootstrap code where possible (though I don't feel too strongly about it myself).

@WebsiteDeveloper
Copy link
Contributor

@peterflynn actually we could just listen for the hide event on dialog and then remove the wrapper if we want to avoid modifying bootstrap.

@peterflynn
Copy link
Member

@WebsiteDeveloper Sounds reasonable to me -- have you tested it out locally? If it works reliably, definitely put up a pull. Thanks!

@redmunds
Copy link
Contributor Author

@WebsiteDeveloper Thanks for looking at this!

@JeffryBooher
Copy link
Contributor

@redmunds should we close this in lieu of #5579?

@redmunds
Copy link
Contributor Author

I wasn't sure if we wanted to take both, because it might make sense to have the dialog-button class on the close buttons.

@redmunds
Copy link
Contributor Author

Closing.

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

Successfully merging this pull request may close these issues.

5 participants