Skip to content

Commit

Permalink
Remove inexplicable +1 in posAtCoords
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Jun 27, 2022
1 parent 60e178b commit 5378d08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/domcoords.ts
Expand Up @@ -260,7 +260,7 @@ export function posAtCoords(view: EditorView, coords: {top: number, left: number
}

let elt = ((view.root as any).elementFromPoint ? view.root : doc)
.elementFromPoint(coords.left, coords.top + 1) as HTMLElement
.elementFromPoint(coords.left, coords.top) as HTMLElement
let pos
if (!elt || !view.dom.contains(elt.nodeType != 1 ? elt.parentNode : elt)) {
let box = view.dom.getBoundingClientRect()
Expand Down

0 comments on commit 5378d08

Please sign in to comment.