Escape key keymap in editor

1 Answer 112 Views
Editor
Shane
Top achievements
Rank 2
Iron
Iron
Iron
Shane asked on 06 Sep 2022, 03:59 PM

I need to overwrite the default escape key keymap. I want to call my own function to cancel the editor when the user presses escape. I have a keymap for handling the Ctrl+s key. Escape doesn't seem to work the same way. Any ideas?

keymap({
'Ctrl-s': (e) => {
if (onCtrlSave) {
let value = getHtml(e.doc);
onCtrlSave({
sender: 'kendoEditor',
value: value
});
}
return true;
}
}),

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 08 Sep 2022, 11:43 AM

Hi Shane,

Thank you for reaching out to us.

The keymap executes the plugins by their order and some of them might prevent the propagation (which is the case with Enter, Esc and some other keys used internally). To avoid this you can just change the order of the plugins:

Please give this a try and let me know if everything works as expected.

 

Regards,
Konstantin Dikov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Editor
Asked by
Shane
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or