Skip to content

Commit 7905c11

Browse files
authored
fix: table handles would crash (#2384)
1 parent 5589b66 commit 7905c11

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/core/src/extensions/TableHandles/TableHandles.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,13 @@ export class TableHandlesView implements PluginView {
296296
event.clientX >= tableRect.right - 1 &&
297297
event.clientX < tableRect.right + 20;
298298

299-
// without this check, we'd also hide draghandles when hovering over them
300299
const hideHandles =
301-
event.clientX > tableRect.right || event.clientY > tableRect.bottom;
300+
// always hide handles when the actively hovered table changed
301+
this.state?.block.id !== tableBlock.id ||
302+
// make sure we don't hide existing handles (keep col / row index) when
303+
// we're hovering just above or to the right of a table
304+
event.clientX > tableRect.right ||
305+
event.clientY > tableRect.bottom;
302306

303307
this.state = {
304308
...this.state!,

0 commit comments

Comments
 (0)