Skip to content

Commit 6ac5448

Browse files
authored
fix: improve cell selection logic in merge cells (#311)
1 parent 77e3cb2 commit 6ac5448

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/input.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,5 +287,8 @@ function cellUnderMouse(
287287
top: event.clientY,
288288
});
289289
if (!mousePos) return null;
290-
return mousePos ? cellAround(view.state.doc.resolve(mousePos.pos)) : null;
290+
// Use `inside` position when available (when pointer is inside a node),
291+
// otherwise fall back to `pos`
292+
const pos = mousePos.inside >= 0 ? mousePos.inside : mousePos.pos;
293+
return cellAround(view.state.doc.resolve(pos));
291294
}

0 commit comments

Comments
 (0)