-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 to elements provided via URL hash #2668
[fix] scroll to elements provided via URL hash #2668
Conversation
🦋 Changeset detectedLatest commit: eec3dd7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks for refining the anchor behaviour. I have a few comments below, but it would also be great to have a new test to check for manual user scrolling on mount.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM. I'll wait a couple more days before merging so any maintainers can give another round of sanity check.
I'd like to know where this broke. Can you narrow down which release that happened at? |
I upgraded from 76 to 188, but there's someone who posted a more narrow version range at #2664 (comment). Changes in that same area of the code were also made in #2489, but I don't know if that caused it. |
Could you check the versions between those 10 to find out which one it is exactly? It would help to review this to know what happened |
It's a 112 version difference so I'm not sure that's possible 😄 But I'm very certain #2489 introduced the regression, since initially we do the auto hash scrolling after the component mounted, but that PR moved it to before mounted in order to respect users manual scrolling. But that inadvertently caused a bug with this specific use case because auto hash scrolling only works after mounted. #2489 was released in 1.0.0-next.175 |
Just a 10 version range since the issue says:
The one you mentioned sounds pretty likely since it falls in that range |
✅ Confirmed, it works in 174 and is broken in 175. |
packages/kit/test/apps/basics/src/routes/anchor-with-manual-scroll/_tests.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Ben McCann <[email protected]>
Co-authored-by: Ben McCann <[email protected]>
Before submitting the PR, please make sure you do the following
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpx changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0Fixes #2664.
I also took the liberty to fix two test cases in packages/kit/test/apps/basics/src/routes/use-action/_tests.js as part of this PR.