ProseMirror / prosemirror

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

`splitBlock` splits 1 character before caret position #1321

Closed schristiansson closed 1 year ago

schristiansson commented 1 year ago

How to reproduce:

  1. Create a function that utilizes the splitBlock function
  2. Place caret somewhere in the text and execute the function
  3. Done

Issue found on Chrome Version 106.0.5249.119 (Official Build) (arm64)

splitBlock

Possible fix update this row to tr.split(tr.mapping.map($from.pos + 1), 1, types)

marijnh commented 1 year ago

splitBlock is the main command bound to Enter in almost every ProseMirror setup, everywhere, and as you can see on https://prosemirror.net, it does not in normal circumstances split in the wrong position. So you're going to have to provide more information on how/when this issue occurs.

schristiansson commented 1 year ago

Thank you, marijnh. Issue seems to be our implementation (Using tiptap above prosemirror) tries to splitBlock for some reason. I will have to investigate further. Thank you for you reply and sorry for wasting your time.