-
Notifications
You must be signed in to change notification settings - Fork 83
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
[dialog] Modeless dialog does not honor close on outside click #7778
Comments
This is kind of by design as the "modeless" overlay doesn't use global outside click / Esc key listeners: web-components/packages/overlay/src/vaadin-overlay-mixin.js Lines 244 to 252 in d665940
We did have to add some workarounds for it especially custom outside click listener for |
If this is not a bug.. it probably has to be documented on the flow side on either modal or closeOnOutsideClick - I was kinda suprised by this :) We use setModal(false) often because of the "problems" with server-side modality; which renders the closeOnOutsideClick flag "useless". |
Note, you can have modal dialog and disable the server side modality using API in UI class. |
Something is wrong if people start using non-modal dialogs to work around server-side modality. Maybe there should be a more obvious API on the component level to disable it. Right now disabling it is not straightforward:
For comparison, this works: add(dialog);
dialog.open();
ui.setChildComponentModal(dialog, false); And these don't: dialog.open();
ui.setChildComponentModal(dialog, false); add(dialog);
ui.setChildComponentModal(dialog, false);
dialog.open(); |
Description
Using modeless (setModal(false) does not honor
closeOnOutsideClick
and stays open.Expected outcome
Dialog closes when clicking outside.
Minimal reproducible example
Environment
Vaadin version(s): 24.4.10
Browsers
All
The text was updated successfully, but these errors were encountered: