0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-24 22:46:02 -05:00

Increase the scroll restoration throttle time (#8981)

* 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>
This commit is contained in:
Matthew Phillips 2023-11-02 08:42:14 -04:00 committed by GitHub
parent 74fa4adba0
commit ab7e745cc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Increase the scroll restoration throttle time

View file

@ -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 = '';