ckeditor5-react icon indicating copy to clipboard operation
ckeditor5-react copied to clipboard

No ability to listen to events.

Open burtonator opened this issue 5 years ago • 2 comments

I need to override some core behavior in ckeditor5 so I can respond to clicks and events in the react area but that seems to be impossible as there is no onKeyDown or onClick event listeners exposed from ckeditor...

burtonator avatar Nov 20 '20 19:11 burtonator

Hi, you can listen to the mentioned events directly on the document view. At first, you'll need to get the editor instance, then set up a listener:

const viewDocument = editor.editing.view.document;

viewDocument.on( 'keydown', ( evt, data ) => {
	console.log( evt, data );
} );

Mgsy avatar Nov 23 '20 07:11 Mgsy

Hi @Mgsy, how about listening to dialogDefinition ?. Is it possible to customize the link dialog with a custom React component?

luiskhernandez avatar Nov 29 '20 17:11 luiskhernandez