Skip to content

Commit 9143c1f

Browse files
authored
fix: table padding and selection (#432)
* fix: table padding when it gets scrolled The handler was getting out of region when table width was wider than editor size. * fix: modify scroll view padding
1 parent f205f80 commit 9143c1f

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/src/editor/block_component/table_block_component/table_block_component.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class _TableBlockComponentWidgetState extends State<TableBlockComponentWidget>
144144
Widget child = Scrollbar(
145145
controller: _scrollController,
146146
child: SingleChildScrollView(
147+
padding: const EdgeInsets.only(top: 10, left: 10, bottom: 4),
147148
controller: _scrollController,
148149
scrollDirection: Axis.horizontal,
149150
child: TableView(

lib/src/editor/block_component/table_block_component/table_cell_block_component.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class _TableCeBlockWidgetState extends State<TableCelBlockWidget> {
118118
position: widget.node.attributes[TableCellBlockKeys.rowPosition],
119119
transform: context.select((Node n) {
120120
final int col = n.attributes[TableCellBlockKeys.colPosition];
121-
double left = -15.0;
121+
double left = -12;
122122
for (var i = 0; i < col; i++) {
123123
left -= getCellNode(n.parent!, i, 0)
124124
?.attributes[TableCellBlockKeys.width] as double;

lib/src/editor/block_component/table_block_component/table_col.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class _TableColState extends State<TableCol> {
6767
node: widget.tableNode.node,
6868
editorState: widget.editorState,
6969
position: widget.colIdx,
70-
transform: Matrix4.translationValues(0.0, -15.0, 0.0),
70+
transform: Matrix4.translationValues(0.0, -12, 0.0),
7171
alignment: Alignment.topCenter,
7272
menuBuilder: widget.menuBuilder,
7373
dir: TableDirection.col,

0 commit comments

Comments
 (0)