MCPcopy Create free account
hub / github.com/adobe/react-spectrum / withTarget

Function withTarget

packages/react-stately/src/virtualizer/ScrollAnchor.ts:159–172  ·  view source on GitHub ↗
(target: number)

Source from the content-addressed store, hash-verified

157 contentSize: Size
158): Rect | null {
159 let withTarget = (target: number): Rect =>
160 axis === 'x'
161 ? new Rect(
162 target,
163 previousVisibleRect.y,
164 previousVisibleRect.width,
165 previousVisibleRect.height
166 )
167 : new Rect(
168 previousVisibleRect.x,
169 target,
170 previousVisibleRect.width,
171 previousVisibleRect.height
172 );
173
174 if (anchor) {
175 let target = computeScrollAnchorTarget(

Callers 1

resolveScrollAdjustmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected