I have RichTextEditor and process paste function witch in Internet Explorer 11 not working correct, copied text get triplicated. Event that handles pasting is fired three times in IE 11. In Chrome everything is working fine.
/**
* Set the pasted data back into the RadEditor
*/
ns.RichText.RichTextEditor.prototype.processPaste = function () {
this.editor.get_document().body.innerHTML = Telerik.Web.UI.Editor.Utils.convertWordLists(this.editor.get_html());
this.editor.fire("FormatStripper", { value: "WORD" });
// Set the original content back and insert the newly pasted content at the caret position
var pastedHTML = this.editor.get_html(true);
// Reposition the cursor where it was before pasting and then paste the formated html there
if (this.editorContent === "") {
this.editorContent = "<br>";
}
this.editor.get_document().body.innerHTML = this.editorContent;
this.restoreSelection();
var range = this.editor.getSelection().getRange();
range.deleteContents();
var frag = range.createContextualFragment(pastedHTML);
range.insertNode(frag);
this.pasting = false;
};
I think this line of code are problem
range.deleteContents();
var frag = range.createContextualFragment(pastedHTML);
range.insertNode(frag);
they cause event on pasting to fire three times.
Is there any way to handle inserting pasted text different in IE in code?