wouter icon indicating copy to clipboard operation
wouter copied to clipboard

Prevent "back button" navigation

Open joecarl opened this issue 9 months ago • 5 comments

I'm developing an app where I need to prevent "back button" in some cases, (e.g.: when I'm editing a form and I click back button I should receive a confirmation dialog before the navigation occurs).

I tried adding the well known beforeunload event. But it only works when the navigation was not made via pushState/setLocation. Is it possible to achieve the behavior I need with wouter?

joecarl avatar May 29 '24 10:05 joecarl