0

这是 Google Chrome(版本 25.0.1364.97 m)中的错误吗?...它在 Safari 中的行为符合预期

如果您首先将一些文本拖放到内容可编辑的 div 中......然后将图像或任何元素拖放到该文本中......并非总是但经常......如果您在第一个字母之前立即放置 obj一句话……那封信被删了……

有任何想法吗 ?...这是示例代码...

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
Is this a Bug in Chrome ?<br><br>
<div id="main" contenteditable="true" style="border:solid 1px black; width:300px; height:300px" spellcheck="false" ></div>
<br><br>


Select some text and drag it into the contenteditable box ...<br><br>

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's built and run by you as part of the Stack Exchange network of Q&A sites. With your help, we're working together to build a library of detailed answers to every question about programming.
We're a little bit different from other sites. Here's how:<br><br>

Then drag and drop an image into the text ...

<img width="50px" src="http://www.gravatar.com/avatar/f7b22b86b0da570ddb5d1d4923b0f4f4" alt="">
<img width="50px" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTmjD0kayL4VTZqfYDNavlQuNvOaBd4o4HjrnNlgbNhUfVy5QfrLg" alt="">

and drag and drop it around ...<br><br>
If you drop it right before the first letter of a word ... often it deletes that first letter in Chrome ???<br><br>

Any Ideas ?

</body>
</html>
4

1 回答 1

0

抓住了同样的错误。
我不知道这是否是 Chrome 错误,但这是我的解决方法:尝试将句子中的每个单词都包含在 <span> 中。
它帮助了我!

于 2013-06-13T06:36:00.507 回答