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

View Transition scroll position not restored. #93

Open
JakeAngell opened this issue Jan 23, 2024 · 2 comments
Open

View Transition scroll position not restored. #93

JakeAngell opened this issue Jan 23, 2024 · 2 comments
Labels
bug Something isn't working external package Problems caused by other (npm) packages help wanted Extra attention is needed

Comments

@JakeAngell
Copy link

When ViewTransitions are enabled the scroll position is meant to be restored after the browser back button is pressed. Something here seems to be preventing the scroll event handler setting its co-ordinate history in state, so the ViewTransitions component returns the user to 0,0 instead.

Is there anything you know of that could be preventing this? Another dev has had the issue with the AlpineJS package but that's not in use here.

@morja
Copy link

morja commented Jan 25, 2024

The issue with AlpineJS turned out to be the x-cloak directive in the html tag. It sets the height of the document to 0 for a brief moment. Maybe something similar happens here?
See this thread for more details on the AlpineJS issue: https://discord.com/channels/830184174198718474/1198642088951165058

@markteekman
Copy link
Owner

@JakeAngell @morja hmm, weird. I just followed the docs for adding the View Transition so that will need some debugging I guess. I'll see what I can do when I have the time to look at it, any help is appreciated of course! As far as I know, there's nothing this theme or the components do to the height of the document, but there are other packages to look at of course.

@markteekman markteekman added bug Something isn't working help wanted Extra attention is needed external package Problems caused by other (npm) packages labels Jan 26, 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 external package Problems caused by other (npm) packages help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants