Skip to content
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

Increase the scroll restoration throttle time #8981

Merged
merged 3 commits into from
Nov 2, 2023
Merged

Conversation

matthewp
Copy link
Contributor

@matthewp matthewp commented Nov 1, 2023

Changes

  • This increases the throttle time to ever 350ms.
  • Safari adds a warning in the console if you exceed 100 calls to replaceState ever 30 seconds. 30/100 == 300ms. So our previous throttle would hit the threshold. The new one will not, we only will call it a max of 99 times.

Testing

  • Tested manually scrolling around a lot.

Docs

N/A, bug fix

Copy link

changeset-bot bot commented Nov 1, 2023

🦋 Changeset detected

Latest commit: 76148ea

The changes in this PR will be included in the next version bump.

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Nov 1, 2023
@github-actions github-actions bot added the docs pr A PR that includes documentation for review label Nov 1, 2023
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking, but a small suggestion!

packages/astro/src/transitions/router.ts Outdated Show resolved Hide resolved
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
@matthewp matthewp merged commit ab7e745 into main Nov 2, 2023
13 checks passed
@matthewp matthewp deleted the vt-safari-throttle branch November 2, 2023 12:42
@astrobot-houston astrobot-houston mentioned this pull request Nov 2, 2023
natemoo-re added a commit that referenced this pull request Nov 22, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs pr A PR that includes documentation for review pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants