【问题标题】:Why does TinyMCE require typing something before being able to use the delete key properly?为什么 TinyMCE 需要输入一些内容才能正确使用删除键?
【发布时间】:2010-07-20 18:12:07
【问题描述】:

我刚刚实现了 TinyMCE,它运行良好,只是用户必须输入一些内容,甚至是空格字符,才能删除内容。

如果您需要更多信息,请告诉我。

【问题讨论】:

  • 感谢您的回复!我必须绕道大约一天,然后处理一些更紧迫的事情 - 但我一定会尽快尝试你的答案并回来。

标签: javascript tinymce


【解决方案1】:

这是一个浏览器错误。我过去见过并使用过一种 hacky 解决方法;我暂时无法验证。如果在 TinyMCE 编辑 iframe 加载后调用以下命令,它可能会起作用:

// doc is a reference to the iframe's document
try {
    doc.execCommand("Undo", false, false);
} catch (ex) {}

【讨论】:

    【解决方案2】:

    确实是浏览器错误(几乎是 FF)。我的解决方法是重置设计模式:

    editor_instance = tinymce.EditorManager.getInstanceById(editor_id); //editor id needed here (ed.id)
    editor_instance.getDoc().designMode = 'Off';
    editor_instance.getDoc().designMode = 'On';
    

    【讨论】:

      猜你喜欢
      • 2012-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-15
      • 1970-01-01
      相关资源
      最近更新 更多