Skip to content

fix: account for the vertical scrollbar in column widths (backport #907) - #909

Merged
spike-rabbit merged 2 commits into
siemens:release/27.xfrom
mistrykaran91:backport/907-vertical-scrollbar-27.x
Nov 27, 2026
Merged

spike-rabbit merged 2 commits into
siemens:release/27.xfrom
mistrykaran91:backport/907-vertical-scrollbar-27.x

Conversation

@mistrykaran91

Copy link
Copy Markdown
Member

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

Backport of #907 to release/27.x. Closes #906.

What is the new behavior?

  • The table width comes from the scroll container's content box (via the existing ResizeObserver), so it excludes a visible vertical scrollbar and the columns are recalculated whenever the scrollbar appears or disappears.
  • The force mode distribution repeats until no column is clamped to its min or max width, so the remaining columns absorb the delta.
  • Whether force mode columns bleed is decided with the actual scrollbar width of the scroll container. The now unused ScrollbarHelper and verticalScrollVisible inputs are removed.
  • Horizontal overflow is hidden when only vertical scrolling is enabled.
  • Ghost loading only fills fully visible rows, and the last rendered row index is clamped to the row count.
  • The ghost loader overlay (external paging) takes the body's CSS height, so it clips the rows that do not fit.

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

Cherry-picked from #907 (-x), original author preserved. Differences from main because of the 27.x code base:

  • The force-mode loop change is applied to forceFillColumnWidths in utils/math.ts (there is no force-column-mode-strategy.ts on 27.x); the two new unit tests live in math.spec.ts.
  • computeIndexes clamps with this.rowCount() as there is no controller.rowCount() on 27.x.
  • The resizing specs and testing/resizing.ts from fix: account for the vertical scrollbar in column widths #907 are not included as they don't exist on 27.x.

Tests: npm run test:ci passes (201 passed, 1 skipped). header-cell.component.spec.ts fails to import with a vitest browser-mode error, which also happens on plain release/27.x.

Measure the table width from the scroll container, excluding a visible
vertical scrollbar, and recalculate the columns whenever the scrollbar
appears or disappears. Previously the last column was cut off and a
horizontal scrollbar appeared when the scrollbar showed up after load.

Repeat the force mode distribution until no column is clamped to its
min or max width, so the remaining columns absorb the delta. Use the
actual scrollbar width of the scroll container to decide whether the
columns bleed. Hide the horizontal overflow when only vertical
scrolling is enabled.

(cherry picked from commit f2f694a)
Only fill the fully visible rows with ghost rows and clamp the last
rendered row index to the row count, so ghost loading no longer causes
a vertical scrollbar. Apply the body height to the ghost loader
overlay, so that it clips the rows that do not fit.

(cherry picked from commit 4177f57)
@mistrykaran91
mistrykaran91 marked this pull request as ready for review November 27, 2026 05:22
@mistrykaran91
mistrykaran91 requested a review from a team as a code owner November 27, 2026 05:22

@spike-rabbit spike-rabbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@spike-rabbit
spike-rabbit merged commit 0e9ffb4 into siemens:release/27.x Nov 27, 2026
3 checks passed
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.

3 participants