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: .changeset/fix-lane-change-layout.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,21 +10,22 @@ Fixed a critical bug where changing the number of lanes dynamically would cause
10
10
11
11
**Fix**: Skip `initialMeasurementsCache` restoration during lane transitions by checking the `lanesSettling` flag. This ensures all measurements are recalculated with correct lane assignments for the new lane count.
12
12
13
-
**Before**:
13
+
**Before**:
14
+
14
15
```typescript
15
16
// With lanes = 2
16
-
virtualItems.forEach(item=> {
17
+
virtualItems.forEach((item)=> {
17
18
columns[item.lane].push(item) // ❌ Error: item.lane could be 3
18
19
})
19
20
```
20
21
21
22
**After**:
23
+
22
24
```typescript
23
25
// With lanes = 2
24
-
virtualItems.forEach(item=> {
26
+
virtualItems.forEach((item)=> {
25
27
columns[item.lane].push(item) // ✅ item.lane is always 0 or 1
26
28
})
27
29
```
28
30
29
31
This fix is essential for responsive masonry layouts where column count changes based on viewport width. No performance impact as it only affects the lane change transition path.
0 commit comments