Contenteditable div not editable in ionic iOS app

Viewed 1135

I am trying to create a text input with emojis in an Ionic app, using a contenteditable div. It works fine in the browser when I serve the app, but the div is not editable when I run the app in the iOS simulator or on an iPhone. The div is visible and if I click it, the keyboard appears, but no cursor. If I type, nothing happens in the div.

<div contenteditable="true">Some text</div>

I suspect this has something to do with the WKWebView, but not sure why this works in Safari, but not in the app. Is there something that needs to be enabled to get it to work?

2 Answers

So the problem was with webkit. I needed to change the user-select option to auto in the CSS for the editable div:

-webkit-user-select: auto;

For my case I had to use

user-select: text;
Related