Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve form values when navigating #761

Closed
Rich-Harris opened this issue Mar 29, 2021 · 1 comment
Closed

Preserve form values when navigating #761

Rich-Harris opened this issue Mar 29, 2021 · 1 comment
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

Comments

@Rich-Harris
Copy link
Member

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 to history.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.

@benmccann benmccann added the feature / enhancement New feature or request label Jul 15, 2021
@Rich-Harris Rich-Harris added this to the 1.0 milestone Apr 6, 2022
@benmccann benmccann added the p2-nice-to-have SvelteKit cannot be used by a small number of people, quality of life improvements, etc. label Jul 20, 2022
@Rich-Harris
Copy link
Member Author

closing in favour of #5478

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants