draft-js icon indicating copy to clipboard operation
draft-js copied to clipboard

Losing cursor position when using ContentEditable and Readonly flags on decorated component

Open jnv22 opened this issue 8 years ago • 3 comments

Do you want to request a feature or report a bug? Bug

What is the current behavior? When when using ContentEditable and Readonly flags on decorated components that are the last element in a single line, the cursor position jumps to the far right. The position returns back to normal when typing

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started: https://jsfiddle.net/stopachka/m6z0xn4r/. (click to the right of "Superman". All that I've done is erase the content below and add contentEditable={false} readOnly to the TokenSpan component) https://codepen.io/anon/pen/BqOePj

Screenshot of bug: screen shot 2018-10-23 at 09 10 11 am

What is the expected behavior? Cursor should be just to the right of "Superman"

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?

Draft 0.10.5 Chrome 69.0.3497.100

jnv22 avatar Oct 23 '18 13:10 jnv22

Just to add it happens also when decoration is at the begining, so in the example above, if Superman is the first item in a line - cursor will be lost on the left side.

negyxo avatar Jul 28 '19 16:07 negyxo

@negyxo Did you find a solution for this?

yeou avatar Oct 22 '19 14:10 yeou

Unfortunately not, it's not critical in my app, so I can live with it...

negyxo avatar Oct 22 '19 19:10 negyxo