ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.53k stars 334 forks source link

Clicking on the padding at the top of the editor returns the wrong position which prevents it from triggering a gap cursor #1435

Open hollykurt opened 7 months ago

hollykurt commented 7 months ago

Steps to Reproduce

Try: https://codesandbox.io/p/sandbox/tiptap-click-above-block-with-content-9lwqgg

  1. Just click above the padding at the top, it returns position 1, and no gap cursor appears.
  2. Click between the "WAT" nodes. it returns position 8, and no gap cursor appears.

You can see the resulting position for the click in the browser console.

This used to work in 1.30.0, try it again in: https://codesandbox.io/p/sandbox/tiptap-click-above-block-with-content-forked-yyf6gd

Where the only change is to pin to prosemirror-view@1.30.0, and it will work.

This seems to be a regression in posFromCaret.