Preserve form values when navigating #761
Labels
feature / enhancement
New feature or request
p2-nice-to-have
SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
Milestone
Is your feature request related to a problem? Please describe.
In a traditional server-rendered app, if you fill in a form (like the one I'm filling in right now) and navigate away, the values will be preserved and reinstated when you navigate back. As with basically all SPA-ish frameworks (I think? would be curious to see prior art that addresses this issue), that doesn't happen in SvelteKit apps — instead, forms are created anew when you navigate.
Describe the solution you'd like
Ideally, when navigating forward or back to a page with form elements, they should have any previous values filled in unless
autocomplete="off"
. The values should be attached tohistory.state
, not the URL in question.Describe alternatives you've considered
It could be left to the user, via navigation lifecycle functions.
How important is this feature to you?
It's part of making apps that feel really solid and robust, but I'd still file it under nice-to-have rather than truly essential.
The text was updated successfully, but these errors were encountered: