javascript - wysihtml5 光标跳到新行的错误位置

标签 javascript jquery jquery-plugins wysihtml5 bootstrap-wysihtml5

当点击'return' 或'enter' 时,光标不跟随实际行。有解决问题的方法吗?插件有几个分支可以解决这个问题,但我很好奇解决它的实际解决方案是什么。

这是一个基于项目的 jQuery 插件:https://github.com/jhollingworth/bootstrap-wysihtml5/你可以看到错误:http://jhollingworth.github.io/bootstrap-wysihtml5/ (按回车几次)

最佳答案

这个问题已经讨论过on the project's GitHub page .

修复是 mentioned in the above thread :

// "commenting these lines (5869 and 5870) in wysihtml5-0.3.0.js fixes it:
// composer.commands.exec("insertLineBreak");
// event.preventDefault();"
// 
// Example:

if (keyCode === wysihtml5.ENTER_KEY && !wysihtml5.browser.insertsLineBreaksOnReturn())  {
    //composer.commands.exec("insertLineBreak");
    //event.preventDefault();
}

关于javascript - wysihtml5 光标跳到新行的错误位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25210034/

相关文章:

javascript - jQuery fadeOut() 和 fadein() 计时

javascript - 为什么alert/console.log 使用 Jquery 拖放运行不同的数量

jquery - 在jquery中如何引用具有特定标题属性的div?

javascript - 具有月 View 和事件 View 的日期选择器?

jquery-ui - 如何在扩展功能中将参数传递给jquery UI对话框按钮功能?

javascript - 如何获取2个字符串之间的字符串

javascript - Backbone 中的 .get() 问题

javascript - 从ajax延迟响应中获取jsonObject

javascript - 如何使用 jquery 自动完成不同的值

javascript - Firefox 中的不平滑 div 动画