kit icon indicating copy to clipboard operation
kit copied to clipboard

SvelteKit concatenates pages instead of swapping them on navigation

Open rChaoz opened this issue 1 year ago • 3 comments

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:

https://github.com/user-attachments/assets/97ec8fce-7139-44dd-9f1d-d42cbd0cfccf

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 avatar Aug 04 '24 14:08 rChaoz

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

khromov avatar Aug 04 '24 18:08 khromov

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.

rChaoz avatar Aug 04 '24 21:08 rChaoz

same issue here

Feuerhamster avatar Aug 06 '24 20:08 Feuerhamster