#view transition + scroll
4 messages · Page 1 of 1 (latest)
Based on the information from the provided extracts, it seems that there have been some discussions and issues related to the behavior of view transitions and scroll restoration in Astro.
In a Discord support thread (https://discord.com/channels/830184174198718474/1148568577046224896), a community member asked if there was a way to keep the scroll position when refreshing a page that uses view transitions. A trusted support staff member responded that there is no option to keep the actual scroll position.
Another community member asked if scroll position storage is not working yet with view transitions. The support staff clarified that scroll behavior with view transitions mimics normal behavior. Navigation to a URL without a hash part goes to the top of the page. History back and forward navigation should take you where you had been before on that page you navigate to.
In a Github issue (https://github.com/withastro/astro/issues/7847), a user reported that view transitions should restore the scroll position on the back button. The user suggested adding the scrollTop into the history.state.
However, it's important to note that the behavior of view transitions and scroll restoration may vary depending on the specific implementation and the browser being used. If you're experiencing issues, it may be helpful to provide a minimal reproducible example to the Astro community for further assistance.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@west briar kapa.ai is still learning and improving, please let us know how it did by reacting below
@west briar What might look like odd scroll behavior might in deed be the effect of the morph transition that scales/translates the old part of a transition group to the new part. Feel free to open a #1019713903481081876 thread with a concrete example to discuss and ping me!