当点击'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/