Open newset opened 10 years ago
:+1:
I first noticed this bug in Chrome Canary few months ago and in Chrome few weeks ago. Not happening in Firefox or Safari.
Does it happen with this version: http://edicy.github.io/wysihtml5/
The repo here is not maintained anymore. I suggest switching over.
@Waxolunist Yup. I tested it and it works perfectly.
oh, I submitted at the wrong place, this comes with bootstrap-wysihtml5. https://github.com/jhollingworth/bootstrap-wysihtml5
This is not maintained either. If you want an up to date wysihtml5 editor with bootstrap3 integration I strongly suggest my own repo: https://github.com/Waxolunist/bootstrap3-wysihtml5-bower
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(); }
@Waxolunist thanks for the link to working versions! :+1: :smile: @htmlboy Your fix worked for me as well :beers:
People following @htmlboy's suggestion, for editing the minified version:
Remove the following from line 163: &&(e.commands.exec("insertLineBreak"),g.preventDefault())
@htmlboy comment works perfectly. thanks @htmlboy
@htmlboy & @kurtfunai thanks so much! This works great.
@nathanhamilton I actually ended up having issues with the fix mentioned in @htmlboy's comments. After adding it to our app, newlines were not being correctly added via the wyshtml project.
I actually ended up migrating to a new/active fork of this project: https://github.com/Voog/wysihtml It is pretty similar, but has some nice improvements (no longer uses iFrames, resizes text area by default, and does not have this bug)
Best of luck!
@kurtfunai Thank you so much for letting me know you had issues. I will check out that project!
I have this bug, when press enter key once, then press it again, the cursor will first move down, then move up to the line before. and this is only affecting Chrome, anybody help?