-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Milestone
Description
Describe the bug
I just started using pushState/replaceState and realized that they don't trigger beforeNavigate, and so I cannot ask the user to confirm before navigating away from a modal form.
I have a rather big webapp that will need to have complex forms in modals. Users definitely want to be asked for confirmation before losing complex form state.
Reproduction
This modal will ask for confirmation when clicking the cancel button, but not on pressing back in the browser:
https://stackblitz.com/edit/sveltejs-kit-template-default-fsoasb?file=src%2Froutes%2FModal.svelte
There's a beforeNavigate that should be showing the confirmation, but it isn't called.
Logs
No response
System Info
Forked the newest Sveltekit Stackblitz.
Severity
Serious. My users can lose some large amounts of state when navigating away from a dirty form.
Additional Information
No response
ignissak, alexzaugarov, xamir82, dennisregalado, AleksandrIvanenko and 11 more