I'm facing a strange issue:
On a contenteditable
<span>
with predefined content in the html, the text cursor jumps back to a certain point whenever you start typing a new word. The location it jumps to is at the end of the original content.
Example:
<span contenteditable>foo</span>
This is happening on Android Chrome 91.0.4472.120, Android 11, using Gboard 10.6.02.371892758-release-arm64-v8a. I also tested on desktop Chrome and IOS Safari. The problem can't be reproduced there, only Andriod Chrome.
This doesn't happen for block elements such as <p>
or <div>
, but if I set display:inline
on say, a <p>
using css, the problem is the same as with the span.
It also doesn't happen if the element does not initially contain text (ex. <span contenteditable></span>
), even if it is edited by the user to contain text afterwards.
Any ideas as to why this is happening? It seems like some sort of bug with Chrome/Android. Is there a workaround/fix for it?
Note: I need to use contenteditable and inline since I want the element to wrap without taking up the whole line, so input or textarea isn't an option.