use*_*291 9 html javascript google-chrome contenteditable
问题:
我观察到Chrome和Opera中的一个不良行为,当一个人通过删除它们之间的分隔来加入两个p标签时就会发生这种行为.Chrome和Opera删除contenteditable = false元素(小部件)和文本之后.
例:
HTML:
<div contenteditable="true" class="editor">
<p>This is the first paragraph.</p>
<p>←Place your cursor here and press backspace. <span class="widget" contenteditable="false">widget</span> Text after widget</p>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.widget{
display: inline-block;
padding: 5px;
background-color: gray;
}
.editor{
font: 20px Trebuchet MS
}
Run Code Online (Sandbox Code Playgroud)
题:
为什么?如何解决?
| 归档时间: |
|
| 查看次数: |
1143 次 |
| 最近记录: |