raviger: useNavigationPrompt does not work with Back button

Thanks for the work & maintenance you put into this router. I have found an issue where I have a complex form, and need to prompt the user if they try to navigate away with unsaved changes. That works great for events that trigger the beforeunload event (hard page reload, navigate to a different site outside the SPA) or that use raviger’s navigate, but it doesn’t work with the browsers Back button.

Has there been any consideration for supporting the interception of the back button within the SPA?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (23 by maintainers)

Most upvoted comments

Awesome, thank you so much!