Add resizable columns to rich text tables#273
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const handleMouseMove = (event: MouseEvent) => { | ||
| const deltaX = event.clientX - startX; | ||
| const nextLeftWidth = Math.max(MIN_COLUMN_WIDTH, leftWidth + deltaX); | ||
| const nextRightWidth = Math.max(MIN_COLUMN_WIDTH, rightWidth - deltaX); | ||
|
|
||
| cols[columnIndex].style.width = `${nextLeftWidth}px`; | ||
| cols[columnIndex + 1].style.width = `${nextRightWidth}px`; |
There was a problem hiding this comment.
Preserve resized column widths in saved HTML
Column resizing only updates the DOM widths on the existing <col> elements (cols[columnIndex].style.width = …, cols[columnIndex + 1].style.width = …) without writing any corresponding data into the Lexical editor state. Because serialization still relies on $generateHtmlFromNodes, any resized widths are dropped as soon as the document is saved or reloaded, so users lose their column adjustments after persisting content.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task