Handling beforeunload
with Partials enabled makes no effect
#2519
Labels
feat
New feature or request
beforeunload
with Partials enabled makes no effect
#2519
Hello! First of all I want to send a huge "thank you" to everyone collaborating in this project.
While trying to handle the
beforeunload
event in an island (to show a confirmation dialog before the user leaves the page) I noticed that it didn't do anything. I finally noticed that it stopped working when enabling Partials in my app, so it seems that's the issue.Is this something expected when working with Partials? Is there a workaround that I can use to have Partials enabled + handling the
beforeunload
event?Thank you very much!!
How to reproduce
I created a example repository with the minimal Fresh app handling the event to show a confirm dialog:
https://github.com/palpfiction/fresh-beforeunload-with-partials
The
main
branch doesn't use Partials and shows it working correctly when navigating. In the branchusing-partials
you can see that the confirm dialog doesn't show up anymore when navigating to the other page.The text was updated successfully, but these errors were encountered: