【问题标题】:drag & drop image onto text in contenteditable div deletes first letter of word in chrome?将图像拖放到contenteditable div中的文本上会删除chrome中单词的第一个字母吗?
【发布时间】:2013-02-13 18:10:45
【问题描述】:

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

如果您首先将一些文本拖放到内容可编辑的 div 中......然后将图像或任何元素拖放到该文本中......并不总是但经常......如果您在单词的第一个字母……那个字母被删除了……

有什么想法吗? ...这是示例代码...

<!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>

【问题讨论】:

    标签: html google-chrome drag-and-drop contenteditable


    【解决方案1】:

    发现了同样的错误。
    我不知道这是否是 Chrome 错误,但这是我的解决方法:尝试将句子中的每个单词都包含在 中。
    这对我有帮助!

    【讨论】:

      猜你喜欢
      • 2012-05-26
      • 2012-09-07
      • 2011-12-10
      • 1970-01-01
      • 2018-07-05
      • 1970-01-01
      • 2012-02-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多