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

Fixes resizeable columns when the first row has a colspan #4955

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jaapvanhoek
Copy link

@jaapvanhoek jaapvanhoek commented Mar 7, 2024

The width of columns get lost when the first row has a colspan that spans the sized columns because the colwidth (which has a comma separated list of column-widths) gets cast to an int and thus removing the other column-widths

Please describe your changes

The comma separated column-widths for the spanned columns are now split before that are cast to an int.

How did you accomplish your changes

By calling .split on the colwidth variable each width can be parsed separately.

How have you tested your changes

I added the colwidth attribute to the existing example and noticed that it did not behave as expected. Only the first of the spanned columns got the right width. After I changed the code the result was like expected and all columns have the right size, either the given pixel value or it fills the remaining space.

How can we verify your changes

  1. Create a table
  2. Merge the columns/cells of the first row
  3. Resize multiple columns that are spanned by the first row
  4. Use the output HTML as the input for a new table when tiptap loads
  5. The size of each column must be equal to the value that it was given.

Remarks

The issue was with both TableCell and TableHeader

Checklist

  • [v] The changes are not breaking the editor
  • Added tests where possible
  • [v] Followed the guidelines
  • Fixed linting issues

Related issues

Copy link

netlify bot commented Mar 7, 2024

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit 769ec8b
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/6641bb140a5c5f000845c784
😎 Deploy Preview https://deploy-preview-4955--tiptap-embed.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@bdbch bdbch left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready to Merge
Development

Successfully merging this pull request may close these issues.

None yet

2 participants