Skip to content

fix(elements): restore sticky first column for span-free tables - #738

Merged
wesleyboar merged 5 commits into
TACC:mainfrom
wesleyboar:fix/table-sticky-column-backward-compat-no-spans
Sep 8, 2026
Merged

fix(elements): restore sticky first column for span-free tables#738
wesleyboar merged 5 commits into
TACC:mainfrom
wesleyboar:fix/table-sticky-column-backward-compat-no-spans

Conversation

@wesleyboar

@wesleyboar wesleyboar commented Sep 5, 2026

Copy link
Copy Markdown
Member

Overview

Restore first-column pinning for "dumb" tables — those with no [colspan]/[rowspan] anywhere — narrowing the breaking change from #735 to only tables that actually use a span.

Related

Changes

  • consolidated the sticky first-column rule in table--basic.css into one selector: a <th> without [colspan] always pins; a <td> pins too, but only in a table with no [colspan]/[rowspan] anywhere

Testing

  1. npm run build:css
  2. npm start
  3. Open http://localhost:3000/components/preview/table--via-paragraphs
  4. Scroll horizontally; confirm its plain <td> first column pins again (no spans anywhere in this table)
  5. Open http://localhost:3000/components/preview/table--with-grouped-header
  6. Scroll each table horizontally; confirm behavior is unchanged from fix(elements)!: only th:first-child pins, unless table has [colspan] #735 (this table has [colspan], so it's excluded from the restored fallback)

Notes

Note

Narrows, but does not remove, the #735 breaking change: a table using [colspan]/[rowspan] whose first column is <td> (not <th>) still doesn't pin. Only span-free tables get the old behavior back.

A "dumb" table with no [colspan]/[rowspan] anywhere never risks
misaligning its first column, so it can safely keep the old
td-or-th pinning behavior; only a table using either span now needs
the stricter th-only rule.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Same matching logic (th without colspan always pins; td pins too in a
span-free table), just one selector instead of two duplicated blocks.
th is already unconditionally covered by the first branch, so the
second branch only ever needs to add td.
Also move :first-child before :is(...) — pseudo-class order within a
compound selector doesn't affect matching, so this is a no-op change.
A prior edit split the bundled :has([colspan], [rowspan]) check into
two :is() branches, which turned "no colspan AND no rowspan" into "no
colspan OR no rowspan" — silently letting a rowspan-shifted <td> pin
again whenever the table had no colspan. Also gives each span type its
own accurate comment instead of one comment covering both.
@wesleyboar
wesleyboar merged commit c5364d0 into TACC:main Sep 8, 2026
@wesleyboar
wesleyboar deleted the fix/table-sticky-column-backward-compat-no-spans branch September 8, 2026 19:04
wesleyboar added a commit that referenced this pull request Sep 8, 2026
PR Generated by `release-please`
---


##
[2.58.1-rc6](v2.58.1-rc5...v2.58.1-rc6)
(2026-09-08)


### Bug Fixes

* **elements:** restore sticky first column for span-free tables
([#738](#738))
([c5364d0](c5364d0))


### Miscellaneous Chores

* release 2.58.1-rc6
([b5d445f](b5d445f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
wesleyboar added a commit to TACC/Core-CMS that referenced this pull request Sep 8, 2026
## Overview

Bumps `@tacc/core-styles` to v2.58.1-rc6, which fixes sticky-column
pinning for CMS tables with a grouped (`[colspan]`) header.

## Related

- TACC/Core-Styles@v2.58.0...v2.58.1-rc6
- TACC/Core-Styles#734
- TACC/Core-Styles#735
- TACC/Core-Styles#738

## Changes

- **updated** `package.json` / `package-lock.json`

## Testing

1. `npm ci && npm run build`
2. Verify CSS build completes with no errors
3. Open a CMS table with a grouped (`[colspan]`) header and a `<td>`
first column.
4. Scroll it horizontally.
5. Verify the first column no longer pins (previously it pinned and
misaligned with the header).
6. Verify a table with no `[colspan]`/`[rowspan]` anywhere still pins
its first column as before.

## UI

### With a proper `<th>` row-header column in `<tbody>`

| Before scroll | After scroll |
| - | - |
| <img width="500" height="450"
alt="table-sticky-column--th-tbody--before-scroll"
src="https://github.com/user-attachments/assets/385433d7-58aa-40cd-9918-bef50e763c08"
/> | <img width="500" height="450"
alt="table-sticky-column--th-tbody--after-scroll"
src="https://github.com/user-attachments/assets/ee3663a7-5788-4f70-a21f-2a9f260017b8"
/> |

### Missing a `<th>` row-header column in `<tbody>` (only `<td>`)

| Before scroll | After scroll |
| - | - |
| <img width="500" height="450"
alt="table-sticky-column--td-tbody--before-scroll"
src="https://github.com/user-attachments/assets/652a467b-c1e6-47d7-acb9-f3e0d4ddc53d"
/> | <img width="500" height="450"
alt="table-sticky-column--td-tbody--after-scroll"
src="https://github.com/user-attachments/assets/228ad940-9e5b-4cb5-b0c3-65c6c4ef69f2"
/> |

## Notes

> [!NOTE]
> All other Core-Styles changes are **not** user facing (CI, docs,
config).
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.

1 participant