Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle new row header property #2724

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

duckRabbitPy
Copy link
Contributor

Description

fixes #2723

When a new row is added below a row that has header styling only give the newly inserted cells the header styling property if a) all of the cells of that column are header cells AND b) there is more than one row in the table OR C) has a defined header property

There was some logic in insertTableRow which says if every cell in the column is a header, then the new cell for that column inserted in row below should be a header too. However this logic does not work if there is only one row (with a header) as all columns will be headers in a single row table and therefore all inserted cells in the row below will be header cells.

Screen.Recording.2023-11-03.at.16.45.19.mov

Copy link

changeset-bot bot commented Nov 3, 2023

🦋 Changeset detected

Latest commit: dd6a2a5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@udecode/plate-table Patch
@udecode/plate Patch
@udecode/plate-serializer-csv Patch
@udecode/plate-serializer-docx Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 3, 2023

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

Name Status Preview Comments Updated (UTC)
plate ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2023 10:58am

Copy link
Contributor

reviewpad bot commented Nov 3, 2023

Thank you @duckRabbitPy for this first contribution!

@reviewpad reviewpad bot added the small Pull request is small label Nov 3, 2023
Copy link
Collaborator

@12joan 12joan left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Can you add some tests for this new behaviour in insertTableRow.spec.tsx, and also add a changeset so that merging this PR triggers a release?

@zbeyens zbeyens merged commit b687374 into udecode:main Nov 28, 2023
4 of 5 checks passed
This was referenced Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Pull request is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

table: all cells in newly inserted row receive header styling when single row
3 participants