I can't understand why clientY for elementFromPoint API plus 1

I am reading the prosemirror-view source code and seen it if i want to get element at point (30,30) and i plus 1 to y,then the return element is point at (30,31),sometimes it may be incorrect.

can someone explain it? thanks a lot

I tried to figure this out, but it’s already there in the first commit in the prosemirror-view repository. It does seem unnecessary and likely to cause subtle problems, so I’ve removed it.

thank you for your reply! and I think the operation of plus 1 should also be removed here,is it?

No, that’s fine the way it is.

ok,i notice that inRect method only use in posAtCoords at some special cases,such as document.elementFromPoint return null or pos can’t be finded.so i guess this method use to resolve some rare problems,it is?if so,can you briefly describe this problem and when the problem will occur?thank you!