Support for window.onBeforeUnload-like behavior with navigation system

In our application, we have very large forms and we would like to warn the user before they navigate away that their form is dirty. Right now, we can use window.beforeUnload to catch “browser-level navigation”, but seemingly we can’t do something similar with RedwoodJS-based navigation. I’ve looked through the navigation documentation and I don’t seem to see what I’m looking for there. Am I missing something, or is this something that RedwoodJS doesn’t support right now? I’m sure we’re not the only folks that would like to parry an accidental navigation

1 Like

Would this PR help you?

That looks like its exactly what we’re looking for :star_struck:.

Cool! As I said in the PR - I’ll take a look as soon as I find some free time for it

1 Like