-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
I have found an instance of when 'saveSelection' is called, that it incorrectly saves a selection outside of the editor. You can reproduce the issue by going to (https://mindmup.github.io/bootstrap-wysiwyg/) and following these instructions.
- Highlight/select the text 'Go ahead'.
- Click on the Create Hyperlink/Anchor button.
- Click into the 'URL' input box placing focus on the box.
- Hover over the editor area, and then take the mouse cursor outside the editor onto the page.
- Click on the page to make the 'URL' input box lose focus and the dropdown to close.
You should see the temporary highlight stick around rather than have the selection return properly. Here is my suggested fix.
Wysiwyg.prototype.saveSelection = function() {
var currentRange = this.getCurrentRange();
if (typeof currentRange !== "undefined" &&$.contains(this.editor[0], $ (currentRange.commonAncestorContainer).parent()[0]))
{
this.selectedRange = this.getCurrentRange();
}
};
Metadata
Metadata
Assignees
Labels
No labels