Prosemirror: Safari: You can't create a cursor inside a NodeSelection containing a text node

Created on 12 May 2021  路  1Comment  路  Source: ProseMirror/prosemirror

Steps to reproduce

  1. Open https://ash-placid-shake.glitch.me in Safari.
  2. Click the button to select the blockquote node.
  3. Try to click inside the selected blockquote as you would to insert more text. You can't.
  4. (Also note that typing text will prepend text to the following text node.)

Issue details

I think the root cause of this is Safari's caretRangeFromPoint returns after the selected node for some reason. Probably needs some kludge.

ProseMirror version

https://prosemirror.net/examples/prosemirror.js retrieved 12 May 2021

Affected platforms

  • [x] Safari

Chrome and Firefox are unaffected

Screenshots / Screencast (Optional)

Most helpful comment

There was a workaround for this already, but it only handled the case where the selected node was the direct parent of the text. Attached patch extends this to work for any selected ancestor nodes.

>All comments

There was a workaround for this already, but it only handled the case where the selected node was the direct parent of the text. Attached patch extends this to work for any selected ancestor nodes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WesleyKapow picture WesleyKapow  路  5Comments

aeneasr picture aeneasr  路  6Comments

geakstr picture geakstr  路  7Comments

igorbelikov picture igorbelikov  路  5Comments

SamyPesse picture SamyPesse  路  3Comments