facebookarchive / draft-js

A React framework for building text editors.
https://draftjs.org/
MIT License
22.58k stars 2.64k forks source link

[Bug] EditorBlock with other element have contentEditable = false #884

Open anvotrinh opened 7 years ago

anvotrinh commented 7 years ago

I create a custom block, and use this with an element have attr contentEditable = false. when selectall text (ctrl + A) --> selector point to wrong position.

<div>
    <EditorBlock {...props} />
    <span
      contentEditable={false}
    >
      sometext
    </span>
</div>

You can try it, create some blockquote and use ctrl + A https://jsfiddle.net/anvotrinh/77nyz190/1/

Dakuan commented 7 years ago

I'm also running into this, another js fiddle: https://jsfiddle.net/f144k3j0/

If you press the insert span button, hello and a space gets inserted. Remove that space and the caret goes to the far right. Here is a gif of my personal use case:

feb-20-2017 15-20-38