HTML5 contenteditable attribute not working properly on iOS7 Mobile Safari

tangential picture tangential · Jan 22, 2014 · Viewed 9.2k times · Source

It seems that the contenteditable attribute (which worked fine on iOS6) has stopped working on iOS7 webkit. Though the browser seems to recognize the field as editable, and brings up the keyboard, any input seems to close it, or it fails to register. Any encounter the same problem, or have any workarounds?

You can try it out over here - http://html5demos.com/contenteditable

Thanks!

Answer

Jason P picture Jason P · May 20, 2014

I ran into this problem today. The solution for me was to set user-select to "text" in the CSS for any editable elements:

* {
    -webkit-user-select: none;
    user-select: none;
}

input,
textarea,
[contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}