Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 616
Chandrew Avatar asked Aug 08 '14 18:08

Chandrew


1 Answers

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();
}
like image 59
alex Avatar answered Oct 16 '22 08:10

alex