Open atatanasov opened 7 years ago
So you added this code into the bootstrapy-wysiwyg.js file?
Yes. This is correct. We are using version 1.0.4 and I can't push this to master, because the code in the master is different, but I'm sure that this bug still exists in master.
Have you tested this with the latest 2.0.1 release?
Using the multiple-editors.html
in the examples
folder of 2.0dev
this bug still exists. In fact, almost any button clicked in either editor, results in that same button being clicked in the other editor. This is especially bad when using the text alignment options as it actually applies that alignment to both editor windows simultaneously. This applies to the ordered/unordered lists as well.
Hi thought i'd publish my fix here :
i inserted this code before "mouseup keyup mouseout" listener it will reset selection if the mouse leaves an editor and enters en other editor.
.on("mouseenter", function() {
if(window.getSelection && window.lastWysiwygEditor !== editor[0].id) {
if(window.getSelection().empty) { // Chrome
window.getSelection().empty();
}
else if(window.getSelection().removeAllRanges) { // Firefox
window.getSelection().removeAllRanges();
}
}
else if (document.selection) { // IE?
document.selection.empty();
}
})
.on("mouseleave", function() {
window.lastWysiwygEditor = editor[0].id;
})
Replication steps:
Actual Result: Bold button in the second editor is selected Expected Results: only the bold button in the first editor is selected
I added the following code in order to fix this: