Fit a read-only table's rows to their cells
Some checks failed
Commit messages lint / commitlint (push) Has been cancelled
Some checks failed
Commit messages lint / commitlint (push) Has been cancelled
A table keeps each row's height on its cells, corrected after every layout through a transaction. A read-only editor applies no transaction (EditorState.apply returns while it isn't editable), so a table shown read-only kept the heights it was stored with, or the default of one line: a cell of several lines ran over its row's borders. The table's own height (colsHeight) already took the read-only case in place; the rows' heights now do the same. Upstream's main has the same code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi
This commit is contained in:
parent
83bdb2a3e6
commit
81c3006c74
1 changed files with 26 additions and 0 deletions
|
|
@ -209,6 +209,14 @@ class TableNode {
|
|||
_cells[i][row],
|
||||
{TableCellBlockKeys.height: maxHeight},
|
||||
);
|
||||
// A read-only editor applies no transaction, so its rows would
|
||||
// keep their height whatever their cells hold: they take it in
|
||||
// place, as the table's height below does.
|
||||
if (editorState != null && editorState.editable != true) {
|
||||
_cells[i][row].updateAttributes(
|
||||
{TableCellBlockKeys.height: maxHeight},
|
||||
);
|
||||
}
|
||||
} else {
|
||||
_cells[i][row].updateAttributes(
|
||||
{TableCellBlockKeys.height: maxHeight},
|
||||
|
|
|
|||
Loading…
Reference in a new issue