-
Notifications
You must be signed in to change notification settings - Fork 63
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 doesn't automatically close if navigating with RouterLinks #1541
Comments
Automatically closing any open Dialog whenever there's a navigation event would break use cases where there's navigation within different sections of a (modal) dialog. This means that the behaviour should somehow be configurable. Some potential approaches for dealing with this:
|
A method like the I am able to implement a workaround for my project to address my issue by implementing a BeforeLeaveObserver to check all components currently set to the main UI of the current view, and if it matches the (modal/component) Dialog, it will close it out. Using the project I attached as an example:
|
@ttsanton not sure if it works for your use case as well, I could get around with the following: public class SelfclosingDialog extends Dialog implements AfterNavigationObserver {
@Override
public void afterNavigation(AfterNavigationEvent event) {
this.close();
}
} Dunno what's more resource hungry, |
In either case, you can use either |
Attached is an example project using version 13.0.0.alpha1. Made using Eclipse and a Wildfly 14 server.
DialogOpened.zip
Steps to re-create:
The Dialog will not close on its own and will persist into the new view.
The text was updated successfully, but these errors were encountered: