-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
tablesRelates to Lexical TablesRelates to Lexical Tables
Description
When importing a table with column headers, the TableCellHeaderStatus is not set correctly.
Link to relevant code in Lexical codebase:
https://github.com/facebook/lexical/blob/30ada8475a779d3c7ded4323b8782f1d5483430c/packages/lexical-table/src/LexicalTableCellNode.ts#L341C1-L347C5
Steps To Reproduce
Set this as the editor value:
<table>
<tr>
<th><p>Name</p></th>
<td><p>Email</p></td>
</tr>
<tr>
<th><p>Alice</p></th>
<td><p>alice@example.com</p></td>
</tr>
</table>Add a new row with $insertTableRowAtSelection(). The new row will be this:
...
<tr>
<td></td>
<td></td>
</tr>
</table>Instead, it should be:
...
<tr>
<th></th>
<td></td>
</tr>
</table>The current behavior
Table column headers can only get TableCellHeaderStates.ROW status.
The expected behavior
Table column headers should get TableCellHeaderStates.COLUMN or TableCellHeaderStates.BOTH if it's a header column.
Impact of fix
Editing existing tables with header column will be correct.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
tablesRelates to Lexical TablesRelates to Lexical Tables