-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* allow disableScrollHandling to be called in afterNavigate - fixes #3220 * fix tests * remove .only * format
- Loading branch information
1 parent
b2a8c5c
commit 77a1a73
Showing
7 changed files
with
60 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sveltejs/kit': patch | ||
--- | ||
|
||
allow disableScrollHandling to be called in afterNavigate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...ges/kit/test/apps/basics/src/routes/anchor-with-manual-scroll/anchor-afternavigate.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script> | ||
import { afterNavigate, disableScrollHandling } from '$app/navigation'; | ||
afterNavigate(() => { | ||
disableScrollHandling(); | ||
document.getElementById('abcde')?.scrollIntoView(); | ||
}); | ||
</script> | ||
<div style="height: 180vh; background-color: hotpink;">They (don't) see me...</div> | ||
<div style="height: 180vh; background-color: peru;"> | ||
<p id="go-to-element">The browser scrolls to me</p> | ||
</div> | ||
<p id="abcde" style="height: 180vh; background-color: hotpink;">I take precedence</p> | ||
<div /> | ||
<a href="/anchor-with-manual-scroll/anchor-afternavigate?x=y#go-to-element">reload me</a> |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/anchor-with-manual-scroll/index.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters