Skip to content

Commit 21ea833

Browse files
Fix wrapped line padding clicks
1 parent 144e983 commit 21ea833

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

app/src/features/editor/note-editor.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ function getLeadingPaddingClickLineStart(
228228
return null;
229229
}
230230

231+
const firstVisualLineTop = Math.min(startRect.top, startRect.bottom);
232+
const firstVisualLineBottom = Math.max(startRect.top, startRect.bottom);
233+
if (
234+
event.clientY < firstVisualLineTop ||
235+
event.clientY > firstVisualLineBottom
236+
) {
237+
return null;
238+
}
239+
231240
return event.clientX < Math.min(startRect.left, startRect.right)
232241
? line.from
233242
: null;

0 commit comments

Comments
 (0)