Skip to content

[lexical-table] Bug Fix: ensure colWidths has length equal to number of columns - #7986

Merged
etrepum merged 1 commit into
meta:mainfrom
james-atticus:table-col-widths-excel
Nov 13, 2025
Merged

etrepum merged 1 commit into
meta:mainfrom
james-atticus:table-col-widths-excel

Conversation

@james-atticus

@james-atticus james-atticus commented Nov 13, 2025 •

Copy link
Copy Markdown
Contributor

Description

When pasting a table from Excel, the pasted table has a single col element:

...
<table border=0 cellpadding=0 cellspacing=0 width=261 style='border-collapse:
 collapse;width:195pt'>
<!--StartFragment-->
 <col width=87 span=3 style='width:65pt'>
 <tr height=21 style='height:16.0pt'>
  <td height=21 align=right width=87 style='height:16.0pt;width:65pt'>12</td>
  <td width=87 style='width:65pt'>a</td>
  <td width=87 style='width:65pt'></td>
 </tr>
...

With the above HTML, the DOM import logic would set colWidths = [87]. This was then breaking a plugin we have which assumed that colWidths would have the same length as the number of columns. We could address this in our plugin but it felt more robust to have the core table plugin ensure that colWidths and the number of columns stay in sync.

@vercel

vercel Bot commented Nov 13, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
lexical Ready Ready Preview Comment Nov 13, 2025 5:34am
lexical-playground Ready Ready Preview Comment Nov 13, 2025 5:34am

@meta-cla meta-cla 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 Nov 13, 2025
@etrepum
etrepum added this pull request to the merge queue Nov 13, 2025
Merged via the queue into meta:main with commit 673795f Nov 13, 2025
@etrepum etrepum mentioned this pull request Dec 10, 2025

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — ef34935c Deployed Nov 13, 2025 by vercel[bot]
Preview – lexical — ef34935c Deployed Nov 13, 2025 by vercel[bot]
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.

2 participants