Skip to content

Fix columnHeaderHeight overriding actual content height (#12198)#12286

Merged
qunabu merged 1 commit intodevelopfrom
cursor/fix-column-header-height-override-0a80
Apr 14, 2026
Merged

Fix columnHeaderHeight overriding actual content height (#12198)#12286
qunabu merged 1 commit intodevelopfrom
cursor/fix-column-header-height-override-0a80

Conversation

@sl01k
Copy link
Copy Markdown
Contributor

@sl01k sl01k commented Apr 7, 2026

Context

Fixes #12198. When columnHeaderHeight is set and header content wraps (e.g., via white-space: normal), the overlay THEADs (inline-start, corner) do not match the master THEAD height, causing row misalignment.

Root cause: markIfOversizedColumnHeader() computes oversizedColumnHeaders[level] and adjustColumnHeaderHeights() 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 new syncOversizedColumnHeadersWithDOM() method re-measures the actual rendered THEAD row heights and updates oversizedColumnHeaders to match. When overlays later call adjustColumnHeaderHeights(), 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?

  • Added E2E tests in ColHeader.spec.js:
    1. columnHeaderHeight: 50 (lower than content) with wrapping headers -- verifies overlay THEAD matches master.
    2. columnHeaderHeight: 132 (higher than content) with wrapping headers -- verifies alignment preserved.
    3. Tall header in first column followed by short headers -- verifies tallest height is preserved.
  • Ran ColHeader, RowHeader, autoRowSize, and nestedHeaders E2E tests (276 specs, 0 failures).
  • Ran full Walkontable test suite (659 specs, 0 failures).
  • Ran nestedHeaders rowspan test (passes -- fix does not interfere with rowspan equalization).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature or improvement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Additional language file or change to the existing one (translations)

Related issue(s):

  1. columnHeaderHeight overrides actual content height, causing overlay THEAD misalignment #12198

Affected project(s):

  • handsontable
  • @handsontable/angular-wrapper
  • @handsontable/react-wrapper
  • @handsontable/vue3

Checklist:

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 7, 2026

More templates

npm i https://pkg.pr.new/@handsontable/react-wrapper@12286
npm i https://pkg.pr.new/@handsontable/vue3@12286
npm i https://pkg.pr.new/handsontable@12286
npm i https://pkg.pr.new/@handsontable/angular-wrapper@12286

commit: f469810

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

⚡ Performance Results

Scenario Scripting Rendering Painting Total Δ
Cell Editing 443 ms 245 ms 47 ms 735 ms -1.6% 🔵
Filtering 11 ms 3 ms 0 ms 14 ms -93.2% 🟢
Scroll Down 151 ms 23 ms 25 ms 199 ms +18.5% 🔴
Scroll Left 2276 ms 2209 ms 635 ms 5120 ms +3.4% 🟡
Scroll Right 424 ms 346 ms 112 ms 882 ms +12.4% 🔴
Scroll Up 1952 ms 1885 ms 436 ms 4272 ms +14.1% 🔴
Sorting 7 ms 2 ms 0 ms 9 ms +15.9% 🔴

Regressions

⚠️ Scroll Down regressed +18.5%
Scripting +17.9% slower, Rendering +15.0% slower, Painting +26.2% slower

⚠️ Scroll Right regressed +12.4%
Scripting +12.8% slower, Rendering +10.3% slower, Painting +17.7% slower

⚠️ Scroll Up regressed +14.1%
Scripting +13.5% slower, Rendering +12.5% slower, Painting +24.6% slower

⚠️ Sorting regressed +15.9%
Scripting +16.5% slower, Rendering +13.7% slower

📊 Full interactive report →

@cursor cursor Bot force-pushed the cursor/fix-column-header-height-override-0a80 branch from d149a85 to ed65ead Compare April 7, 2026 22:05
@sl01k sl01k marked this pull request as ready for review April 8, 2026 07:35
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread handsontable/src/3rdparty/walkontable/src/table.js Outdated
@adrianspdev adrianspdev self-assigned this Apr 10, 2026
@adrianspdev adrianspdev self-requested a review April 10, 2026 07:29
@cursor cursor Bot force-pushed the cursor/fix-column-header-height-override-0a80 branch from ed65ead to 908d20f Compare April 10, 2026 08:11
@adrianspdev
Copy link
Copy Markdown
Contributor

@cursoragent Row headers are misaligned; screenshot below:

image

@cursor
Copy link
Copy Markdown
Contributor

cursor Bot commented Apr 10, 2026

The fix has been completely redesigned to address the reviewer's feedback. Here's a summary of what changed:

Summary

  • Reverted the markIfOversizedColumnHeader() changes (removed measuredMaxHeight guard, hasUserColumnHeaderHeight flag, and extra walkontable setting) -- these couldn't handle the case where columnHeaderHeight is higher than content but CSS wrapping still grows the master THEAD beyond the stored value.
  • Added syncOversizedColumnHeadersWithDOM() method in table.js -- after the master table calls adjustColumnHeaderHeights(), it re-measures the actual rendered THEAD row heights and updates oversizedColumnHeaders to match. When overlays later call adjustColumnHeaderHeights(), they receive the correct heights.
  • Added a 1px borderCompensation threshold to avoid false positives from sub-pixel border rounding.
  • Added a third E2E test specifically for the reviewer's scenario: columnHeaderHeight: 132 (higher than content) with wrapping headers.

Testing

  • ✅ ColHeader + nestedHeaders rowspan E2E -- 67 specs, 0 failures
  • ✅ ColHeader + RowHeader + autoRowSize + nestedHeaders E2E -- 276 specs, 0 failures
  • ✅ Walkontable -- 659 specs, 0 failures
Open in Web Open in Cursor 

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>
@cursor cursor Bot force-pushed the cursor/fix-column-header-height-override-0a80 branch from 908d20f to f469810 Compare April 10, 2026 08:56
@adrianspdev adrianspdev requested review from budnix and removed request for adrianspdev April 10, 2026 09:23
@qunabu qunabu merged commit 030279a into develop Apr 14, 2026
34 of 35 checks passed
@qunabu qunabu deleted the cursor/fix-column-header-height-override-0a80 branch April 14, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

columnHeaderHeight overrides actual content height, causing overlay THEAD misalignment

5 participants