Skip to content

[lexical-playground] Bug Fix: Preserve row striping in frozen table columns#7572

Merged
ivailop7 merged 3 commits intofacebook:mainfrom
bgwebagency:fix/table-frozen-column-striping
May 27, 2025
Merged

[lexical-playground] Bug Fix: Preserve row striping in frozen table columns#7572
ivailop7 merged 3 commits intofacebook:mainfrom
bgwebagency:fix/table-frozen-column-striping

Conversation

@kirandash
Copy link
Copy Markdown
Contributor

@kirandash kirandash commented May 27, 2025

Description

Currently, when a table column is frozen using the "Freeze First Column" option, the row striping (alternating row background colors) disappears for the frozen column. This happens because the frozen column cells have a hardcoded white background that overrides the row striping styles.

This PR fixes the issue by:

  • Maintaining row striping in frozen columns by explicitly setting background colors for odd/even rows

Closes #7571

Test plan

Before

image

  • Create a table with multiple rows and columns
  • Right click the first column -> Remove Column Header
  • Right click -> Toggle Row Striping
  • Right click -> Freeze First Column
  • Notice that the frozen column loses its row striping, showing only white background

After

lexical-fix.mov
  • Create a table with multiple rows and columns
  • For the first column -> Remove Column Header
  • Apply row striping using "Toggle Row Striping"
  • Freeze the first column using "Freeze First Column"
  • Verify that the frozen column maintains the same striping pattern as non-frozen columns

Additional tests done:

  • Scroll horizontally to verify the right border remains visible on the frozen column
  • Check that the frozen column properly overlays content while scrolling

- Fix issue where freezing a column would remove row striping
- Maintain proper background colors for odd/even rows in frozen columns
- Preserve sticky positioning and border styling

Fixes facebook#7571
@vercel
Copy link
Copy Markdown

vercel bot commented May 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2025 3:35am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2025 3:35am

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 27, 2025
@kirandash kirandash marked this pull request as draft May 27, 2025 03:17
@kirandash kirandash changed the title [lexical-playground] Bug Fix: Preserve row striping in frozen table columns [WIP][lexical-playground] Bug Fix: Preserve row striping in frozen table columns May 27, 2025
border-bottom: 1px solid #bbb;
}
.PlaygroundEditorTheme__tableFrozenColumn tr > td:first-child {
.PlaygroundEditorTheme__tableFrozenColumn tr:nth-child(odd) > td:first-child {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Probably makes more sense to leave this as the original selector and separately target the even rows when row striping is enabled to only override the background color

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I've updated the code to keep the original selector for frozen columns and handle the row striping with frozen column separately. 20c7dbc

- Maintain proper striping behavior for both regular and frozen columns
@kirandash kirandash changed the title [WIP][lexical-playground] Bug Fix: Preserve row striping in frozen table columns [lexical-playground] Bug Fix: Preserve row striping in frozen table columns May 27, 2025
@kirandash kirandash marked this pull request as ready for review May 27, 2025 03:31
@ivailop7 ivailop7 added this pull request to the merge queue May 27, 2025
Merged via the queue into facebook:main with commit 76b1f12 May 27, 2025
42 checks passed
GermanJablo added a commit to payloadcms/payload that referenced this pull request Sep 3, 2025
Fixes #13386

Below I write a clarification to copy and paste into the release note,
based on our latest upgrade of Lexical [in
v3.29.0](https://github.com/payloadcms/payload/releases/tag/v3.29.0).

## Important
This release upgrades the lexical dependency from 0.28.0 to 0.34.0.

If you installed lexical manually, update it to 0.34.0. Installing
lexical manually is not recommended, as it may break between updates,
and our re-exported versions should be used. See the [yellow banner
box](https://payloadcms.com/docs/rich-text/custom-features) for details.

If you still encounter richtext-lexical errors, do the following, in
this order:

- Delete node_modules
- Delete your lockfile (e.g. pnpm-lock.json)
- Reinstall your dependencies (e.g. pnpm install)

### Lexical Breaking Changes

The following Lexical releases describe breaking changes. We recommend
reading them if you're using Lexical APIs directly
(`@payloadcms/richtext-lexical/lexical/*`).

- [v.0.33.0](https://github.com/facebook/lexical/releases/tag/v0.33.0)
- [v.0.30.0](https://github.com/facebook/lexical/releases/tag/v0.30.0)
- [v.0.29.0](https://github.com/facebook/lexical/releases/tag/v0.29.0)

___

TODO:
- [x] facebook/lexical#7719
- [x] facebook/lexical#7362
- [x] facebook/lexical#7707
- [x] facebook/lexical#7388
- [x] facebook/lexical#7357
- [x] facebook/lexical#7352
- [x] facebook/lexical#7472
- [x] facebook/lexical#7556
- [x] facebook/lexical#7417
- [x] facebook/lexical#1036
- [x] facebook/lexical#7509
- [x] facebook/lexical#7693
- [x] facebook/lexical#7408
- [x] facebook/lexical#7450
- [x] facebook/lexical#7415
- [x] facebook/lexical#7368
- [x] facebook/lexical#7372
- [x] facebook/lexical#7572
- [x] facebook/lexical#7558
- [x] facebook/lexical#7613
- [x] facebook/lexical#7405
- [x] facebook/lexical#7420
- [x] facebook/lexical#7662

---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
  - https://app.asana.com/0/0/1211202581885926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Freezing a column removes the row striping style

4 participants