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

Visibility transition causing rerender issues between routes in Sveltekit #12

Open
madeleineostoja opened this issue May 17, 2022 · 5 comments

Comments

@madeleineostoja
Copy link

madeleineostoja commented May 17, 2022

When initiallyVisible or alwaysVisible is true, Svrollbar doesn't properly rerender when changing routes in Sveltekit, causing layout bugs. This only occurs if the one of the visible override props are used, I assume due to the scrollbar not unmounting/updating in time (is there a rogue exit transition or something?)

Screen.Recording.2022-05-17.at.12.56.52.PM.mov
@madeleineostoja madeleineostoja changed the title intiallyVisible causing rerender issues between routes in Sveltekit initiallyVisible and alwaysVisible causing rerender issues between routes in Sveltekit May 17, 2022
@daylilyfield
Copy link
Owner

@madeleineostoja thanks for reporting. could you reproduce this issue in svelte REPL? or do you have any example source code which can reproduce this issue?

@madeleineostoja
Copy link
Author

I don't have open source code I can share unfortunately, and putting together a sufficient REPL repro would take a while. Let me see if I can put something together when I have some time

@madeleineostoja madeleineostoja changed the title initiallyVisible and alwaysVisible causing rerender issues between routes in Sveltekit Visibility transition causing rerender issues between routes in Sveltekit May 26, 2022
@madeleineostoja
Copy link
Author

Just a quick update, haven't had a chance to build an open source repro project, but with further investigation it's not those props, it's whenever there's pending transitions while changing routes. Changing the transition configs (vThumbIn/Out and vTrackIn/Out) to 0 duration fixes the issue, though obviously isn't a great user experience for actual usage.

@madeleineostoja
Copy link
Author

madeleineostoja commented May 26, 2022

My very hacky workaround for now:

<script>
  let scrollReady = true;

  beforeNavigate(() => (scrollReady = false));
  afterNavigate(() => (scrollReady = true));
</script>

{#if scrollReady}
  <Svrollbar ... />
{/if}

@iliser
Copy link

iliser commented Jun 1, 2022

Yeah I'm also catch this bug.

This bug caused by svelte transiton design, and mostly appear with relative layout and as described here better solution is just use |local modifier on transition.

Also I open PR #11 for solve this, and right now just use fork -_- while awaiting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants