block page refresh/navigation in Svelte if form fields unsaved (using stores and actions)
Channel: SpinSpire
Date: 2021-02-18

Learn how to prevent page unloading and navigation when the user has made changes to form input field. This video uses Svelte stores to reflect form change status, input events to detect changes, and then "beforeunload" event to prevent unloading of the current page.

See code here: https://svelte.dev/repl/16abe40374bb4805a795be60378f14b7?version=3.32.3

For questions, post a comment. For business inquiries, email info@spinspire.com.