Commit 4040cab
fix(#103): GridStack cellHeight() side-effects + bump vertical margins
Two interlocking issues that together produced the merged-row look.
1. GridStack's cellHeight() (the bare getter, no args) is
actually an IMPLICIT SETTER: it recomputes opts.cellHeight as
cellWidth + (marginTop+marginBottom - marginLeft-marginRight)
whenever called, and regenerates the per-y/per-h CSS rules
with the new value. My updateContainerHeight() called it on
every load / capability flip / drag, so opts.cellHeight kept
drifting away from the configured 80 toward whatever the
current container width yielded. That's why bumping margins
never landed exactly where the math predicted — every margin
change shifted the cellWidth-derived cellHeight as a side
effect.
Fix: use getCellHeight(false). Same return value, no setter
side effect, no CSS-rule regeneration.
2. With the cellHeight finally stable at 80, the rows still felt
tight at the prior 18 top/bottom margin. Bumped to 24 each
(48px between rows) which lines up with what the user
sketched as "Better" in the dev-tools screenshot (top: 990
for the y=12 tile = 12*80 + 24/2 + 24/2 in the new math).
Horizontal margins stay at 12 each (24px between side-by-side)
because that gap already looked right.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent eaba5f2 commit 4040cab
1 file changed
Lines changed: 25 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
84 | | - | |
85 | | - | |
| 89 | + | |
| 90 | + | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
| |||
123 | 128 | | |
124 | 129 | | |
125 | 130 | | |
126 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
127 | 142 | | |
128 | 143 | | |
129 | 144 | | |
| |||
0 commit comments