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

Method constructor

packages/@react-spectrum/ai/src/ListLayout.ts:197–219  ·  view source on GitHub ↗

* Creates a new ListLayout with options. See the list of properties below for a description * of the options that can be provided.

(options: ListLayoutOptions = {})

Source from the content-addressed store, hash-verified

195 * of the options that can be provided.
196 */
197 constructor(options: ListLayoutOptions = {}) {
198 super();
199 this.anchorTo = options.anchorTo;
200 this.scrollEndThreshold = options.scrollEndThreshold ?? 0;
201 this.rowSize = options?.rowSize ?? options?.rowHeight ?? null;
202 this.orientation = options.orientation ?? 'vertical';
203 this.estimatedRowSize = options?.estimatedRowSize ?? options?.estimatedRowHeight ?? null;
204 this.headingSize = options?.headingSize ?? options?.headingHeight ?? null;
205 this.estimatedHeadingSize =
206 options?.estimatedHeadingSize ?? options?.estimatedHeadingHeight ?? null;
207 this.loaderSize = options?.loaderSize ?? options?.loaderHeight ?? null;
208 this.dropIndicatorThickness = options.dropIndicatorThickness || 2;
209 this.gap = options.gap || 0;
210 this.padding = options.padding || 0;
211 this.layoutNodes = new Map();
212 this.rootNodes = [];
213 this.lastCollection = null;
214 this.invalidateEverything = false;
215 this.validRect = new Rect();
216 this.requestedRect = new Rect();
217 this.contentSize = new Size();
218 this.warnIfReversedHorizontal();
219 }
220
221 private warnIfReversedHorizontal(): void {
222 if (

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected