You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/virtual-item.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,4 +62,5 @@ The size of the item. This is usually mapped to a css property like `width/heigh
62
62
lane: number
63
63
```
64
64
65
-
The lane index of the item. In regular lists it will always be set to `0` but becomes useful for masonry layouts (see variable examples for more details).
65
+
The lane index of the item. Items are assigned to the shortest lane. Lane assignments are cached immediately based on the size measured by `estimateSize` by default; use `deferLaneAssignment: true` to base assignments on measured sizes instead.
66
+
In regular lists it will always be set to `0` but becomes useful for masonry layouts (see variable examples for more details).
Copy file name to clipboardExpand all lines: docs/api/virtualizer.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -232,7 +232,18 @@ This option allows you to set the spacing between items in the virtualized list.
232
232
lanes: number
233
233
```
234
234
235
-
The number of lanes the list is divided into (aka columns for vertical lists and rows for horizontal lists).
235
+
The number of lanes the list is divided into (aka columns for vertical lists and rows for horizontal lists). Items are assigned to the lane with the shortest total size. Lane assignments are cached immediately based on `estimateSize` to prevent items from jumping between lanes.
236
+
237
+
### `deferLaneAssignment`
238
+
239
+
```tsx
240
+
deferLaneAssignment?:boolean
241
+
```
242
+
243
+
**Default**: `false`
244
+
245
+
When `true`, defers lane caching until items are measured via `measureElement`. This allows lane assignments to be based on actual measured sizes rather than `estimateSize`. After initial measurement, lanes are cached and remain stable.
0 commit comments