wysihtml5 cursor jumps to wrong place on new line
Asked Answered
J

1

6

When 'return' or 'enter' is hit, the cursor does not follow the actual line. Is there a solution to the problem? There are a few forks to the plugin which fixes the issue, but I am curious what the actual solution was to fix it.

This is a jQuery plugin based on the project: https://github.com/jhollingworth/bootstrap-wysihtml5/ and you can see the error: http://jhollingworth.github.io/bootstrap-wysihtml5/ (hit enter a few times)

Jumpoff answered 8/8, 2014 at 18:31 Comment(2)
what browser is this ?Fifteen
@astro Chrome 39.0.2171.71Jumpoff
C
2

This issue has been discussed on the project's GitHub page.

The fix is 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();
}
Coagulum answered 2/1, 2015 at 19:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.