ckeditor / ckeditor5-vue2

Official CKEditor 5 component for Vue.js 2.x.
Other
35 stars 17 forks source link

CKEditor 5 manual user input event #30

Open hnviradiya opened 2 years ago

hnviradiya commented 2 years ago

I am using CKEditor 5 with input event as follows in vue component.

But I need a change event when manually triggered by the user, but it is also triggering during any change in editorData from the code side also.

How can I get the event which is triggered by the user and not from the code in CKEditor 5?

<ckeditor :editor="editor" @input="onEditorInput" v-model="editorData"></ckeditor>
FilipTokarski commented 2 years ago

Hi, could you specify what do you exactly mean by user input? Do you mean only typing? In such case you could for example listen on keydown event:

editor.editing.view.document.on( 'keydown', ( evt, data ) => {
    console.log( evt );
    console.log( data );
} );
hnviradiya commented 2 years ago

Now thing is, user may format things from toolbar. Copy paste from some source. Not sure of any other source that can change data based on action taken by user. Moreover we are unable to determine information of source of the event, even that might have been helpful.

willvitorino commented 1 year ago

Today I'm using CKEditor Plugin's in version 27.0.0. But recently, 9 days ago, the versions went up to 36.0.1 and the v-model just stopped working. Even @input doesn't work.