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

Function layoutSignature

perf/app/layout.mjs:113–125  ·  view source on GitHub ↗
(snapshot)

Source from the content-addressed store, hash-verified

111}
112
113export function layoutSignature(snapshot) {
114 // Virtualizers may reorder DOM nodes or recycle offscreen rows without moving
115 // visible content. Compare geometry in visual order, independent of that work.
116 let visible = snapshot && {
117 ...snapshot,
118 rows: snapshot.rows
119 .filter(row => row.top + row.height > 1 && row.top < snapshot.height - 1)
120 .sort((a, b) => a.top - b.top)
121 };
122 return JSON.stringify(visible, (_, value) =>
123 typeof value === 'number' ? Math.round(value * 10) / 10 : value
124 );
125}
126
127export async function settleLayout(expected) {
128 let previous;

Callers 4

layout.test.mjsFile · 0.90
tickFunction · 0.90
readFunction · 0.90
settleLayoutFunction · 0.85

Calls 2

sortMethod · 0.65
filterMethod · 0.65

Tested by

no test coverage detected