Skip to content

Commit cde50c8

Browse files
committed
fix: simple table buttons
1 parent de5cb54 commit cde50c8

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/components/editor/components/blocks/simple-table/SimpleTableActionButtons.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ export function SimpleTableActionButtons() {
5454
const scrollRect = scrollContainer.getBoundingClientRect();
5555
const tableRect = table.getBoundingClientRect();
5656

57+
// Use the smaller of scroll container width and actual table width
58+
// so buttons stick to the table edge when the table is narrow
59+
const effectiveWidth = Math.min(scrollRect.width, tableRect.width);
60+
5761
setLayout({
5862
scrollLeft: scrollRect.left - rootRect.left,
5963
scrollTop: scrollRect.top - rootRect.top,
60-
scrollWidth: scrollRect.width,
64+
scrollWidth: effectiveWidth,
6165
scrollHeight: scrollRect.height,
6266
tableHeight: tableRect.height,
6367
});

src/components/editor/components/blocks/simple-table/simple-table.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
@apply absolute flex items-center justify-center cursor-pointer pointer-events-auto;
155155
height: 16px;
156156
border-radius: 4px;
157-
background-color: #2D3036;
157+
background-color: var(--fill-list-active);
158158
opacity: 0;
159159
transition: opacity 0.15s ease;
160160

@@ -167,7 +167,7 @@
167167
@apply absolute flex items-center justify-center cursor-pointer pointer-events-auto;
168168
width: 16px;
169169
border-radius: 4px;
170-
background-color: #2D3036;
170+
background-color: var(--fill-list-active);
171171
opacity: 0;
172172
transition: opacity 0.15s ease;
173173

@@ -181,7 +181,7 @@
181181
width: 18px;
182182
height: 18px;
183183
border-radius: 4px;
184-
background-color: #2D3036;
184+
background-color: var(--fill-list-active);
185185
opacity: 0;
186186
transition: opacity 0.15s ease;
187187

0 commit comments

Comments
 (0)