ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.55k stars 3.7k forks source link

Allow disabling of undo / redo key commands in CKEditor #15973

Open kstinson14 opened 8 months ago

kstinson14 commented 8 months ago

๐Ÿ“ Provide a description of the new feature

In our app, we have a form with an existing undo / redo infrastructure. We'd like to disable / override the CKEditor key commands for undo / redo (CTRL/CMD + Z/Y) in order to keep the behavior consistent with our own implementation.

Apologies if there is already a way to do this - I looked through the guides / tried to override events, but couldn't figure it out.


If you'd like to see this feature implemented, add a ๐Ÿ‘ reaction to this post.

Witoso commented 8 months ago

Interesting approach, everything is a plugin so theoretically you could not load Undo but CKEditor 5 is an advanced editor that doesn't operate on the HTML layer, so I would be hesitant to propose it.

There's also possibility to listen on UndoCommand execution like:

editor.commands.get('undo').on('execute', (evt, data) => {  
ย  ย console.log('Undo');  
});