You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think this is a bug, more like a feature request. Cells don't have a fixed width to them (until set by resize), it's all based on whatever your CSS is configured to do. When cells are merged, only the display metadata (style, background color, width) from the top-left cell is used and all of the other cells' metadata is discarded. Unmerge couldn't restore any of the metadata for any of the other cells because it's not anywhere in the document anymore.
I think at best what you could do, in your app, would be to check the widths before merge to see if anything custom is set. If so, calculate the display width of the merged area before merge and then set it on the result after merge. Unmerging the best you could do is distribute any custom width equally across the top row (and the content would all still be in the top-left cell).
This a bug in the playground, but is relevant to anyone trying to implement table resizing.
Screen.Recording.2024-09-12.at.1.37.18.PM.mp4
Merging cells collapses the column width, which is not restored when unmerging (unlike google docs).
Lexical version: v0.17.1
Steps To Reproduce
The current behavior
Table collapses to the size of a single cell. Unmerging expands to the minimum width
The expected behavior
Table retains it's width but has a single cell. Unmerging should restore previous column widths
Impact of fix
The text was updated successfully, but these errors were encountered: