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

SvelteKit concatenates pages instead of swapping them on navigation #12545

Open
rChaoz opened this issue Aug 4, 2024 · 3 comments
Open

SvelteKit concatenates pages instead of swapping them on navigation #12545

rChaoz opened this issue Aug 4, 2024 · 3 comments
Labels
bug Something isn't working svelte This feature can't be implemented without changes to Svelte itself

Comments

@rChaoz
Copy link

rChaoz commented Aug 4, 2024

Describe the bug

When navigating from page A to another, if a Tiptap textfield is focused, SvelteKit completely breaks. Instead of swapping the page, the new page is simply concatenated with the current page. If this text field is not focused, the pages get concatenated only until the out transitions present in page A finish.

Reproduction

  1. Open this SvelteLab
  2. Go to child page
  3. Go back (Alt + )
  4. (1) Why do the pages get concatenated for the duration of the transition?
  5. Go to child page again
  6. Click in the middle of the black box to focus the text field
  7. Go back (Alt + )
  8. (2) Pages remain concatenated forever

Video:

Screen.Recording.2024-08-04.202608.mp4

Related: #12547

Severity

very serious, can't work around it but doesn't always happen

Additional Information

For context, in my project there are two pages: Home and Board.

When I navigate to Home from Board, if the text field is currently focused, not only the pages get concatenated as seen before, but afterwards, every Svelte transition of both pages also breaks/gets stuck and a hard refresh is the only way out. Not sure if related, but my Board page has to be set to CSR only because the SSR result is completely unusable and hydration breaks.

Upgrading to Svelte 5 fixes the main glitches, although there are still some issues and I haven't tested properly.

@rChaoz rChaoz changed the title Multiple pages load on top of each other, afterNavigate called when navigating away SvelteKit loads new page under existing one instead of replacing Aug 4, 2024
@rChaoz rChaoz changed the title SvelteKit loads new page under existing one instead of replacing SvelteKit loads new page under existing one, concatenating instead of replacing on navigation Aug 4, 2024
@rChaoz rChaoz changed the title SvelteKit loads new page under existing one, concatenating instead of replacing on navigation SvelteKit concatenates pages instead of swapping them on navigation Aug 4, 2024
@khromov
Copy link

khromov commented Aug 4, 2024

See here for the Discord discussion regarding this issue: https://discord.com/channels/457912077277855764/1269649724873637968/1269649724873637968

@rChaoz
Copy link
Author

rChaoz commented Aug 4, 2024

The transition/concatenation part seems to be very similar to #628. Although the bug that the first page never dissappears is totally different. Still, I wish there was a way to have global transitions that are not affected by navigation, or to at least have the transitions out play, only then the new page is added. Concatenating the pages doesn't page a lot of sense, especially with layouts.

@Feuerhamster
Copy link

same issue here

@eltigerchino eltigerchino added svelte This feature can't be implemented without changes to Svelte itself bug Something isn't working labels Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working svelte This feature can't be implemented without changes to Svelte itself
Projects
None yet
Development

No branches or pull requests

4 participants