Div with contentEditable does not work at all


#1

Hi,

I want to allow user to edit some div.

I have this code snippet:

<ion-content>
   <div contenteditable="true">Click to Edit me</div>
</ion-content>

Is there any explanation why it’s not editable on click?

Here’s a codepen.

Thanks,

Michael


#2

Your codepen works for me in unless I misunderstood your issue.


#3

@gmarziou I bet you didn’t try with Safari :wink:


#4

I’ve just succeeded:

<div contenteditable="true" style="-webkit-user-select: text; -khtml-user-select: text;-moz-user-select: text;-o-user-select: text;user-select: text;">

This way it works on Safari and others too.


#5

Yes I was on Chrome or Firefox


#6

when i press Enter, the text in the newline can’t be selected. do you have the same issue?