Skip to content

Commit

Permalink
Increase the scroll restoration throttle time (#8981)
Browse files Browse the repository at this point in the history
* Increase the scroll restoration throttle time

* Add changeset

* Update packages/astro/src/transitions/router.ts

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
  • Loading branch information
matthewp and natemoo-re authored Nov 2, 2023
1 parent 74fa4ad commit ab7e745
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/dirty-dolls-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Increase the scroll restoration throttle time
2 changes: 1 addition & 1 deletion packages/astro/src/transitions/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ if (inBrowser) {
addEventListener('popstate', onPopState);
addEventListener('load', onPageLoad);
if ('onscrollend' in window) addEventListener('scrollend', onScroll);
else addEventListener('scroll', throttle(onScroll, 300));
else addEventListener('scroll', throttle(onScroll, 350), { passive: true });
}
for (const script of document.scripts) {
script.dataset.astroExec = '';
Expand Down

0 comments on commit ab7e745

Please sign in to comment.