-
Notifications
You must be signed in to change notification settings - Fork 164
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
Improvement: com.vaadin.flow.router.BeforeLeaveObserver #8400
Comments
So without that e.g. any opening pages from internet-browser-bookmarks cannot signal leaving of page. |
@netbeansuser2019 thank you for the ticket. I move this to the Flow team for further investigations. |
Neither
Instead, we would have to use either Beacon or fetch with |
Dear Vaadin team,
Also in context of #8399 |
if "route component" or even on layout implements com.vaadin.flow.router.BeforeLeaveObserver apply:
https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
https://developer.mozilla.org/en-US/docs/Web/API/Window/unload_event
void beforeLeave(BeforeLeaveEvent event) {
if (event.isBeforeUnLoadBrowserEvent()) {
event.signalUnSavedData(); //to signal unsave data so browser dialog should be shown if possible
} else if (event.isUnloadBrowserEvent() && !event.isFromClient()) {
//housekeeping
} else {
//navigating out by Vaadin framework
}
}
The text was updated successfully, but these errors were encountered: