-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix(#8625): smooth scrolling in SPA mode on iOS * perf(router): run cb every 200ms only when scolling * refactor(router): suggested changes and fixes Suggested changes: - change interval time from 200 to 50ms - initialize `last*` vars together with the call to `setInterval()` - clear interval when scroll positions stop changing, independent of history state Additional changes: - remove unused `throttle()` function - move guarded block to inside `onScrollEnd()` since using history navigation will trigger our "popstate" callback and fire additional "scroll" and "scrollend" events, causing redundant expensive calls to `replaceState()` * adds changeset --------- Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
- Loading branch information
1 parent
2db9031
commit 4bc360c
Showing
2 changed files
with
50 additions
and
28 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 @@ | ||
--- | ||
"astro": patch | ||
--- | ||
|
||
Fixes jerky scrolling on IOS when using view transitions. |
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