Chandrew
Chandrew

Reputation: 17277

wysihtml5 cursor jumps to wrong place on new line

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)

Upvotes: 6

Views: 760

Answers (1)

alex
alex

Reputation: 7453

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();
}

Upvotes: 2

Related Questions