mindmup / bootstrap-wysiwyg

Tiny bootstrap-compatible WISWYG rich text editor
MIT License
5.56k stars 844 forks source link

Bug - Entire selection not underlined/bolded/italicized #194

Open ejg opened 9 years ago

ejg commented 9 years ago

This consistently happens in Chrome (v42.0.2311.135) on Windows.

Go to http://mindmup.github.io/bootstrap-wysiwyg/ type in some text select some of the text –> it is highlighted blue while still holding down the mouse button, move the pointer out of the edit box move the pointer –> more of the text is selected and highlighted blue let go of the mouse button click the U –> only the text up to where the pointer left the edit box is underlined

I fixed this in my code by binding the mouseup event to my parent div instead of to the contenteditable div. That way the current selection is saved even when the pointer is out of the edit box.

That is probably not a very good general solution though since you do not know what the parent div is going to be.