Skip to content

Commit 33d7c1b

Browse files
docs: mention that snapshots take effect when refreshing page (#12425)
* Update 65-snapshots.md * Update documentation/docs/30-advanced/65-snapshots.md Co-authored-by: Conduitry <[email protected]> --------- Co-authored-by: Conduitry <[email protected]>
1 parent e6e0110 commit 33d7c1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

documentation/docs/30-advanced/65-snapshots.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Snapshots
44

55
Ephemeral DOM state — like scroll positions on sidebars, the content of `<input>` elements and so on — is discarded when you navigate from one page to another.
66

7-
For example, if the user fills out a form but clicks a link before submitting, then hits the browser's back button, the values they filled in will be lost. In cases where it's valuable to preserve that input, you can take a _snapshot_ of DOM state, which can then be restored if the user navigates back.
7+
For example, if the user fills out a form but navigates away and then back before submitting, or if the user refreshes the page, the values they filled in will be lost. In cases where it's valuable to preserve that input, you can take a _snapshot_ of DOM state, which can then be restored if the user navigates back.
88

99
To do this, export a `snapshot` object with `capture` and `restore` methods from a `+page.svelte` or `+layout.svelte`:
1010

0 commit comments

Comments
 (0)