I'm having problems on creating a div element with content editable in Ionic application, the text of that div works fine, but when you edit every break line you make is created another div inside the original one, like this: <div contenteditable="true"> This can be edited <div> but this not</div></div>
and this can't be even clickable.
I did the same test without the ionic bundle and works fine.
I create this codepen [http://codepen.io/lhrossi/pen/XNBbpm ] reproducing the issue, I appreciate any help.
答案 0 :(得分:0)
这似乎仅在Chrome中存在问题,但我没有对其进行测试。
解决方案是在元素上添加display:inline-block
。这样,它会为新行添加<br>
而不是<div></div>
。
<div contenteditable="true" style="display:inline-block;"></div>