Fix columnHeaderHeight overriding actual content height (#12198)#12286
Fix columnHeaderHeight overriding actual content height (#12198)#12286
Conversation
commit: |
⚡ Performance Results
Regressions
|
d149a85 to
ed65ead
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ed65ead. Configure here.
ed65ead to
908d20f
Compare
|
@cursoragent Row headers are misaligned; screenshot below:
|
|
The fix has been completely redesigned to address the reviewer's feedback. Here's a summary of what changed: Summary
Testing
|
Treat columnHeaderHeight as a minimum height instead of a fixed override. When header content naturally exceeds the configured height (e.g., long text with white-space: normal), the actual measured height is now used. This prevents THEAD height mismatch between the master table and overlays. Co-authored-by: Marek Martuszewski <sl01k@users.noreply.github.com>
908d20f to
f469810
Compare




Context
Fixes #12198. When
columnHeaderHeightis set and header content wraps (e.g., viawhite-space: normal), the overlay THEADs (inline-start, corner) do not match the master THEAD height, causing row misalignment.Root cause:
markIfOversizedColumnHeader()computesoversizedColumnHeaders[level]andadjustColumnHeaderHeights()applies it to the first TH of each header row. But the master's header row can grow beyond the stored value because other TH cells in the same row have wrapping content that pushes the row taller. Overlay tables have fewer columns (e.g., only the row header), so their header rows don't grow -- creating the mismatch.Fix: After the master table calls
adjustColumnHeaderHeights(), a newsyncOversizedColumnHeadersWithDOM()method re-measures the actual rendered THEAD row heights and updatesoversizedColumnHeadersto match. When overlays later calladjustColumnHeaderHeights(), they receive the correct (actual) master heights. A 1px border-compensation threshold avoids triggering on sub-pixel rounding differences.Before fix:
Before fix - row 1 hidden behind header, THEAD mismatch
After fix:
After fix - all rows aligned, THEAD heights match
How has this been tested?
ColHeader.spec.js:columnHeaderHeight: 50(lower than content) with wrapping headers -- verifies overlay THEAD matches master.columnHeaderHeight: 132(higher than content) with wrapping headers -- verifies alignment preserved.Types of changes
Related issue(s):
Affected project(s):
handsontable@handsontable/angular-wrapper@handsontable/react-wrapper@handsontable/vue3Checklist:
To show artifacts inline, enable in settings.