AG_
AG_

Reputation: 2699

ckeditor not allow to paste on mobile

ckeditor not allow user to copy/paste on mobile, below is screenshot. It gives the error "Your browser is does not allow you to paste this way" and user can;t use ctrl+v on mobile.

enter image description here

Upvotes: 0

Views: 1890

Answers (2)

j.swiderski
j.swiderski

Reputation: 2445

Please see: https://github.com/ckeditor/ckeditor-dev/issues/595.

Problem should be fixed in version 4.8.1. Until then you can use CKEditor 4.6.2 where paste dialog is still available.

The paste dialog was removed in CKEditor 4.7.0 due to couple of reasons - https://dev.ckeditor.com/ticket/16954.

Upvotes: 1

AG_
AG_

Reputation: 2699

I disabled the CKeditor on mobile by adding below code.

This is to check if page is open in mobile

function isMobile() {
    try{ document.createEvent("TouchEvent"); return true; }
    catch(e){ return false; }
}

and then initiate the Ckeditor if not mobile

if(!isMobile()){
   CKEDITOR.replace('note');
}

I am using ajax to submit comment and CKeditor need to update the instance before ajax call.

if(!isMobile()){
    for ( instance in CKEDITOR.instances )
        CKEDITOR.instances[instance].updateElement();
}

And this code make the textarea blank

if(!isMobile())
    CKEDITOR.instances.note.setData('');
else
    $("textarea[name='note']").val('');

Upvotes: 0

Related Questions