Override ENTER key processing in the CKEditor dialog

I am adding an autocomplete function to the CKEditor 3.6 text input dialog box. The problem is that it is not possible to select a value from the list with the ENTER key, because it closes the dialog box, and all the ENTER key events stop from bubbling dom. I see that in _source / plugins / dialog / plugin.js:

// ESC, ENTER var preventKeyBubblingKeys = { 27 :1, 13 :1 }; var preventKeyBubbling = function( e ) { if ( e.data.getKeystroke() in preventKeyBubblingKeys ) e.data.stopPropagation(); }; 

Is there a way to override this behavior without changing the source code? Any other ideas are also welcome!

+4
source share
2 answers

It looks like I will have to put all the contents of the dialog box in an iframe just to get around this. It would be nice if the list of keys prevented from bubbles was customizable and not hard-coded.

0
source

For CKEditor 4, I solved this problem by disabling the OK button during autocomplete and turning it back on when the input loses focus:

CKEDITOR.dialog.getCurrent () getButton ("OK") disable () ..; . CKEDITOR.dialog.getCurrent () getButton ("OK") enable () ;.

0
source

All Articles