Chrome for Android mistakenly autocorrect on contenteditable

212 views Asked by At

I have the following contenteditable area

<div contenteditable="true"><p><br /></p></div>

The "<p><br /></p>" is from the database. It's not I hardcarded it on HTML. So I can't change that. That's a very strange behaviour for Chrome on Android.

When I type 'ok', press enter, and then press backspace again, the text is autocorrected as 'OOk'. And the cursor is still on the second line.

You can try this with Chrome for Android: http://jsfiddle.net/73s4pjz9/

How can I solve this strange bug?

1

There are 1 answers

0
bengvr3 On

Well, you can't, sadly.

To my knowledge (and I've spent hours researching this infuriating bug), there isn't a way to fix it on your end because it's a bug with the WebView class that hasn't been fixed for about 2 years. Basically what happens is Android's autocorrect engine gets out of sync with the contenteditable's selection and things get messy.

Sadly, I wasn't able to find a solution to this bug, so your best bet is to either make Android users suck it up or give them a native textarea without the cool WYSIWYG features.