Behaviour SwRS-MDOKFSTUDIO-TABLE-006
The cell text box wraps and fits its text in the block editor font
When a cell editor is open, the extension SHALL style its text box with the same editor font family, font size and line height as the block editor, wrap the cell text inside the cell with the text box fitted to it, and place a Done button and a Cancel button under the text box inside the cell, compact and wrapping within the column, and in edit mode keep every table cell at least 8em wide and the cell being edited at least 300 px wide, or as wide as the table's box allows in a narrower pane, never under 8em.
Part of StRS-MDOKFSTUDIO-TABLE-001, outside the paths drawn on its map.
Scenarios 9
The situations the tests check; open one to read it.
nominalCell editor next to a block editor
| Pane width | Outcome |
|---|---|
| 900 px: a cell editor and, in another session, a block editor open in the same theme | the computed font family, font size and line height of each text box are equal |
| 460 px: the same cell editor | the three values are unchanged |
nominalLong text wraps and the cell grows
Givena long cell text in a table of three columns, at 900 px and at 460 px
Whenthe cell editor is open
Thenthe text wraps inside the cell, the text box shows no scrollbar and is as tall as its text, the row is taller, and every column keeps the width it had before the editor opened, except that the column of the edited cell grows to 300 px when it was narrower, or to the room of a narrower pane
boundaryUnbreakable text
Givena cell text with no space, longer than the cell
Whenthe cell editor is open
Thenthe text wraps at any character (overflow-wrap anywhere) instead of widening the column
nominalWindow resize
Givena cell editor open with a long text
Whenthe preview width changes
Thenthe text box height is recomputed from its scroll height
the room of the edited cell is measured again from the new width of the table's column
the room of the edited cell is measured again from the new width of the table's column
boundaryNo editor open
Givenno cell editor open
Whenthe preview is resized
Thenno text box is touched
nominalButtons in the cell
Givena cell editor open in a 900 px pane
Whenthe cell is inspected
Thena Done button (accessible name "Done editing") and a Cancel button (accessible name "Cancel editing and restore the original text") are inside the cell, below the text box
nominalMinimum cell width in edit mode
Givena table with a column added without a title (an empty header and empty cells), in edit mode
Whenno cell editor is open
a cell editor opens in that column
a cell editor opens in that column
Thenevery header and body cell is at least 8em wide, so the empty column can be clicked
the edited cell is at least 300 px wide, or the room of the table's box in a narrower pane (never under 8em), its editor and buttons are fully inside it, and the table scrolls horizontally instead of clipping the cell
outside edit mode (reading view) no table cell has a minimum width
the edited cell is at least 300 px wide, or the room of the table's box in a narrower pane (never under 8em), its editor and buttons are fully inside it, and the table scrolls horizontally instead of clipping the cell
outside edit mode (reading view) no table cell has a minimum width
boundaryPane narrower than the cell minimum
Givena pane 280 px wide and a table with row handles, in edit mode
Whenthe cell editor opens in the first column
Thenthe edited cell, its text box and the Done and Cancel buttons are fully inside the table's scroll box and inside the viewport, and the cell is at least 8em wide
the room is the width of the table's column, less the row-handle shift, 16 px on each side (the margin of the sideways reveal) and the padding and borders of the cell; a pane that leaves 300 px or more keeps the 300 px minimum
the room is the width of the table's column, less the row-handle shift, 16 px on each side (the margin of the sideways reveal) and the padding and borders of the cell; a pane that leaves 300 px or more keeps the 300 px minimum
boundaryWide table
Givena sixteen-column table wider than the pane and its far-right cell open
Whenthe cell is inspected
Thenthe buttons wrap within their column and do not widen it
Implemented in 3
Tested by 7
- test/core/preview/previewStyles.test.tsunit
- test/integration/tableEmptyColumn.test.tsintegration
- test/page/runtimeTableCellEditor.test.tsunit
- test/page/runtimeTableCellRoom.test.tsunit
- test/visual/capture_edit_checks.pyvisual
- test/visual/capture_table_cell_room.pyvisual
- test/visual/tableCellRoomScenarios.tsvisual