Home / Function/ updateScrollPosition() — astro Function Reference

updateScrollPosition() — astro Function Reference

Architecture documentation for the updateScrollPosition() function in events.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  15ebcfcc_16b5_91ba_024c_eb33bed45c84["updateScrollPosition()"]
  75c59a6f_ee5d_6669_2750_97d28d913e90["events.ts"]
  15ebcfcc_16b5_91ba_024c_eb33bed45c84 -->|defined in| 75c59a6f_ee5d_6669_2750_97d28d913e90
  574ffb1c_cb40_43b3_2961_9cc3d8a4b81f["doPreparation()"]
  574ffb1c_cb40_43b3_2961_9cc3d8a4b81f -->|calls| 15ebcfcc_16b5_91ba_024c_eb33bed45c84
  style 15ebcfcc_16b5_91ba_024c_eb33bed45c84 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/transitions/events.ts lines 188–193

export const updateScrollPosition = (positions: { scrollX: number; scrollY: number }) => {
	if (history.state) {
		history.scrollRestoration = 'manual';
		history.replaceState({ ...history.state, ...positions }, '');
	}
};

Domain

Subdomains

Called By

Frequently Asked Questions

What does updateScrollPosition() do?
updateScrollPosition() is a function in the astro codebase, defined in packages/astro/src/transitions/events.ts.
Where is updateScrollPosition() defined?
updateScrollPosition() is defined in packages/astro/src/transitions/events.ts at line 188.
What calls updateScrollPosition()?
updateScrollPosition() is called by 1 function(s): doPreparation.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free