CKEditor's click event not firing

前端 未结 2 899
不思量自难忘°
不思量自难忘° 2020-12-21 16:09

I am using CKEditor 4.4.3 and trying to listen to an editor\'s click event:

editor.on(\'click\', function (e) {
      console.log(\'click event from attachin         


        
2条回答
  •  猫巷女王i
    2020-12-21 16:46

    Correct way of attaching listeners to the editable element in CKEditor:

    editor.on( 'contentDom', function() {
        var editable = editor.editable();
        editable.attachListener( editable, 'click', function() {
            // ...
        } );
    } );
    

    Read more about the reasons why contentDom event has to be used instead of e.g. instanceReady in editable.attachListener documentation.

提交回复
热议问题