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

Fix scroll position in view transition (#7882) #7911

Merged
merged 2 commits into from
Aug 2, 2023
Merged

Fix scroll position in view transition (#7882) #7911

merged 2 commits into from
Aug 2, 2023

Conversation

martrapp
Copy link
Member

@martrapp martrapp commented Aug 1, 2023

Changes

Fixes #7882

When the click handler navigates to a page, it now resets the current scroll position to zero.
Otherwise, the new page might be shown half way scrolled down, depending on the scroll position of the previous page.

Testing

Manual test: Linked the fixed module into a local copy of https://stackblitz.com/edit/github-fmqrqm?file=src%2Fpages%2Fother-page.astro

Docs

@changeset-bot
Copy link

changeset-bot bot commented Aug 1, 2023

🦋 Changeset detected

Latest commit: 081134c

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Aug 1, 2023
@natemoo-re natemoo-re linked an issue Aug 1, 2023 that may be closed by this pull request
1 task
@ematipico ematipico requested a review from matthewp August 2, 2023 08:55
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me, but I leave the final review to @matthewp

@martrapp
Copy link
Member Author

martrapp commented Aug 2, 2023

I appreciate Matthew's review!
The PR fixes my scrolling issues, but I'm not sure it fits the intended design of the transition feature.

@matthewp
Copy link
Contributor

matthewp commented Aug 2, 2023

Looks good, thanks!

@matthewp matthewp merged commit c264be3 into withastro:main Aug 2, 2023
@astrobot-houston astrobot-houston mentioned this pull request Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

viewTransitions: clicking a link doesn't reset scrollY to 0
3 participants