Skip to content

fix: Use JS-driven isLast class for borderless resizer positioning - #5224

Draft
NathanZlion wants to merge 1 commit into
mainfrom
fix/borderless-resizer-column-groups
Draft

NathanZlion wants to merge 1 commit into
mainfrom
fix/borderless-resizer-column-groups

Conversation

@NathanZlion

@NathanZlion NathanZlion commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Description

With column groups and borderless/embedded/full-page tables, the last leaf column of a group had its resize divider misaligned by 12px when a standalone column with rowspan=2 followed the group.

The resizer wrapper uses inset-inline-end: -12px by default to straddle the cell boundary. A CSS th:last-child rule reset it to 0 for borderless tables to prevent overflow at the table edge. With column groups, a standalone column with rowspan=2 is rendered only in the group header row, so the leaf row's th:last-child becomes the group's last leaf column — not the table's rightmost column. The CSS rule incorrectly pulled that column's resizer 12px inward.

Replaced the th:last-child CSS rule with the existing JS-driven .is-last class, which identifies the rightmost column via colIndex + colSpan === totalColumns regardless of DOM row structure.

Related links, issue #: AWSUI-62435

How has this been tested?

  • Opened the column-groups dev page with variant=borderless, single-level groups preset
  • Verified the resize divider on the last leaf column of each group aligns with the group header divider
  • Verified the rightmost column (Cost) still has its resizer pulled inward to prevent table overflow
  • tsc --noEmit passes
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates. N/A — CSS-only fix, no API change.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md. Yes, no public API changes.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md. Yes, only moved an existing CSS rule.
  • Changes were manually tested for accessibility, see accessibility guidelines. N/A — visual positioning only, no accessibility impact.

Security

Testing

  • Changes are covered with new/existing unit tests? The existing resizable-columns tests cover the .is-last class behavior.
  • Changes are covered with new/existing integration tests? N/A

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.76%. Comparing base (8a3001d) to head (f00f7cf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5224   +/-   ##
=======================================
  Coverage   97.76%   97.76%           
=======================================
  Files        1003     1003           
  Lines       32572    32572           
  Branches    12109    12110    +1     
=======================================
  Hits        31843    31843           
+ Misses        723      684   -39     
- Partials        6       45   +39     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…erless resizer positioning

With column groups, a standalone column with rowspan=2 is rendered in the group header row only. The leaf row's th:last-child becomes the group's last leaf column, not the table's rightmost column. The CSS rule pulled that column's resizer 12px inward, misaligning it with the group header divider.

Replace the th:last-child CSS rule with the existing JS-driven .is-last class, which correctly identifies the rightmost column via colIndex + colSpan === totalColumns regardless of rowspan.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The selector change leaves the last classic-mode resize handle at a negative inset, extending it beyond the table edge and potentially causing horizontal overflow.

1 open issue
What changed in this PR

Fixes resize-divider alignment in Cloudscape tables with column groups by using logical column position rather than DOM row order.

Changes:

  • Removes the th:last-child wrapper-positioning rule.
  • Moves the inset reset to the existing JavaScript-driven .is-last selector for visual-refresh borderless tables.
File Description
src/​table/​resizer/​styles.scss Uses .is-last to position the final column’s resize wrapper.

Review effort: Balanced

Comment on lines 85 to +86
.resizer-wrapper.visual-refresh.is-borderless.is-last {
inset-inline-end: 0;

This branch was successfully deployed

3 active deployments
dev-pages-react16 — f00f7cf8 Deployed Nov 2, 2026 by NathanZlion via deploy (React 16) / deploy #3086
dev-pages-react18 — f00f7cf8 Deployed Nov 2, 2026 by NathanZlion via deploy (React 18) / deploy #3086
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.

2 participants