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

Allow clicking off modal windows to close them #6753

Open
NormPlum opened this issue Nov 18, 2024 · 3 comments
Open

Allow clicking off modal windows to close them #6753

NormPlum opened this issue Nov 18, 2024 · 3 comments

Comments

@NormPlum
Copy link

Description of the need

When viewing the Project Details modal on the /admin/modules/install page, I have to specifically click on the close icon to close the modal.

Proposed solution

It'd be nice if I could also click anywhere outside the modal in order to close it.

@olafgrabienski
Copy link

olafgrabienski commented Nov 18, 2024

Thanks for the report, and welcome to the Backdrop issue queue!

To discuss whether a click outside a modal should close it, we should also consider other dialogs in Backdrop, e.g. inserting a link or an image, or configuring a block. As those dialogs may contain data that could be lost by closing the window accidentally, I'm skeptical about the proposal.

That said, there is another way to close a modal window in Backdrop easily: hit the esc key.

@quicksketch
Copy link
Member

Hi @NormPlum! Welcome to the Backdrop community and thank you for opening this issue!

Would it make sense to have this be a per-dialog option? The project details modal is a great situation where there's no chance of data loss, and you're also opening and closing a lot of modals. Click anywhere to close would make sense. However, I think the default should still be the current behavior, to prevent data loss on modals that contain forms. Though I suppose we could make a "smart default" of detecting if there is a form and adjusting the behavior, unless it was manually specified otherwise.

@NormPlum
Copy link
Author

I haven't come across other modals in Backdrop yet, so if this doesn't work all the time then understandable that it's not a default feature. But for this page at least I think it'd be handy.

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

No branches or pull requests

3 participants