-
Notifications
You must be signed in to change notification settings - Fork 7
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
UnloadObserver should know whether the user stayed on the page after prompt #176
Comments
Did you also try using the Beacon API in an |
I guess using the Beacon API for this is hard because there is no easy way to expose an endpoint to which the Beacon request could be sent. Probably it would be better/easier to integrate this feature into Vaadin Flow itself. Maybe this could even be enabled by default and the server should close the UI in response to the unload event. |
@mperktold thanks for feedback! I looked at the Beacon API and there were two reasons why I did not do any further work; my JS skills are less than I would want them to be, plus as you noticed, there is no easy way to ping the server if you believe this should be a built-in feature of flow, feel free to create a ticket in vaadin/flow repository, but as for now there are no plans to introduce any functionality like this (simply because the usage would be marginal) |
I've created an actual running example based on my idea with the Beacon API. See https://vaadin.com/forum/thread/17523194/18399446 for more details. |
Great! I will adapt this code in one of the next releases. |
#170 allows querying the user before leaving the page, but there is currently no way to find out whether or not the user stayed on the page (because
unload
events have no connection to the server).There probably is a way to find it out, and it would be nice to have it implemented in
UnloadObserver
.The text was updated successfully, but these errors were encountered: