You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement a smooth transition of a component between page navigations.
On page A I have a searchbar centered on the screen, in between some other things.
On page B, there is no searchbar component.
In a layout which applies to both A & B I display the searchbar whenever A is not the current page. So when I add C & D the searchbar is still visible, since it lives in the layout.
Now I would like to animate the searchbar to the top whenever A is left for another page. So I added a crossfade transition in a helper ts file which both, A and the layout import and use for the searchbar component.
This works so far. But when I navigate away, sveltekit waits with the navigation until the transition has finished. So what happens is:
Searchbar starts moving to the new position in the layout
Searchbar is done moving
Old content disappears
New page is shown
but what I'd like to happen is:
Searchbar starts moving to the new position in the layout
Old content disappears
New page is shown
Searchbar is done moving
Or in simple words: I would like the navigation to not wait for the transitions to finish. When applying the |local modifier the transition is not done at all. But I want it to run, just not to block the whole page navigation.
Is there a way to achieve this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to implement a smooth transition of a component between page navigations.
On page A I have a searchbar centered on the screen, in between some other things.
On page B, there is no searchbar component.
In a layout which applies to both A & B I display the searchbar whenever A is not the current page. So when I add C & D the searchbar is still visible, since it lives in the layout.
Now I would like to animate the searchbar to the top whenever A is left for another page. So I added a crossfade transition in a helper ts file which both, A and the layout import and use for the searchbar component.
This works so far. But when I navigate away, sveltekit waits with the navigation until the transition has finished. So what happens is:
but what I'd like to happen is:
Or in simple words: I would like the navigation to not wait for the transitions to finish. When applying the |local modifier the transition is not done at all. But I want it to run, just not to block the whole page navigation.
Is there a way to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions