0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00
astro/packages
Sandeep Dilip 4bc360cd5f
fix(#8625): smooth scrolling in SPA mode on iOS (#10235)
* 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>
2024-03-03 16:59:19 +01:00
..
astro fix(#8625): smooth scrolling in SPA mode on iOS (#10235) 2024-03-03 16:59:19 +01:00
astro-prism Use eslint-plugin-regexp (#9993) 2024-02-07 20:43:19 +08:00
astro-rss chore: use biome to sort imports - only test files (#10180) 2024-02-21 14:08:19 +00:00
create-astro chore: import sort source code, exception for the astro package (#10242) 2024-02-27 11:15:27 +00:00
db [ci] release (#10292) 2024-03-02 00:42:07 -08:00
integrations [ci] release (#10292) 2024-03-02 00:42:07 -08:00
internal-helpers Use eslint-plugin-regexp (#9993) 2024-02-07 20:43:19 +08:00
markdown/remark chore: import sort source code, exception for the astro package (#10242) 2024-02-27 11:15:27 +00:00
telemetry chore: import sort source code, exception for the astro package (#10242) 2024-02-27 11:15:27 +00:00
underscore-redirects chore: import sort source code, exception for the astro package (#10242) 2024-02-27 11:15:27 +00:00
upgrade chore: import sort source code, exception for the astro package (#10242) 2024-02-27 11:15:27 +00:00