praniclift
praniclift

Reputation: 126

TinyMCE pastes to editor twice on Ctrl + V

Using the jQuery version, everything works as expected except when anything is pasted into the editor, it pastes double what I expect.

Init script:

$('textarea.editor').tinymce({
    theme : "modern",
    menubar : false,
    plugins: [
        "paste advlist autolink lists link charmap print preview anchor",
        "searchreplace visualblocks code",
        "contextmenu paste"
    ],
    paste_auto_cleanup_on_paste : true,
    paste_remove_styles: true,
    paste_remove_styles_if_webkit: true,
    paste_strip_class_attributes: "all",
});

Upvotes: 1

Views: 1399

Answers (1)

praniclift
praniclift

Reputation: 126

Found the issue on the bug tracker: I've accidentally defined the "paste" plugin twice. Removing one instance fixes the double-pasting:

$('textarea.editor').tinymce({
    theme : "modern",
    menubar : false,
    plugins: [
        "paste advlist autolink lists link charmap print preview anchor",
        "searchreplace visualblocks code",
        "contextmenu" // second "paste" declaration was hiding here
    ],
    paste_auto_cleanup_on_paste : true,
    paste_remove_styles: true,
    paste_remove_styles_if_webkit: true,
    paste_strip_class_attributes: "all",
});

Upvotes: 2

Related Questions