CKEditor:将小部件作为第一个元素,select 在 Chrome 中都不起作用

CKEditor: with widget as first element, select all not working in Chrome

如果您将小部件添加为第一个元素,Ctrl+A 将无法在 Chrome 中使用。如果之前添加了一些文本,则 "select all" 可以完美运行。

任何解决方法?

我正在使用 ckeditor 4.5.5。

试穿 Widget Demo

注意:在 Firefox 中,Ctrl+A 有效,但在第一个小部件中添加了标签 <br type="_moz"></br>

当小部件是可编辑区域中的第一个或最后一个元素时,在 Blink 或 WebKit 浏览器中选择内容时出现问题是一个已知问题,已在此处报告:https://dev.ckeditor.com/ticket/11180。正如您在票证报告中所见,我们还能够在本机 contenteditable 元素中重现此问题,这表明存在浏览器错误。遗憾的是,我们无法找到解决此问题的任何方法,浏览器供应商尚未提供修复程序。


备注:

  • 可在此处找到小部件演示:https://sdk.ckeditor.com/samples/simplebox.html。您提供的 link 是使用 CKEditor 4.1 的旧控件预览(控件在 CKEditor 4.3 中正式引入)。
  • 您提到的这些br's是Firefox插入的。没有什么可担心的,因为一旦您使用 editor.getData method. Here is a good general explanation of how it works: Want to remove the <br type="_moz"> tag in CKEDITOR 4.2.0
  • 从编辑器中获取数据,它们就会被过滤掉