I have a custom ajax function, save(), that I call on my form when I press CTRL/CMD + S:
document.addEventListener("keydown", function(e) {
if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) {
e.preventDefault();
save();
}
}, false);
I'm using CKEditor 4 for my textarea field:
CKEDITOR.replace('content',{ height: '250px' });
If the focus isn't on the CKEditor textarea, pressing CTRL/CMD + S calls the save() function triggered from the "keydown" listener.
However, if focus is on the CKEditor textarea, pressing CTRL/CMD + S calls my browser "Save Page As" dialog (note: I'm on Chrome FWIW).
How can I make sure that the save() function is executed even when focus is on the CKEditor textarea?
Any help would be most appreciated.
Thanks,
Bardi

I think that Chrome had a bug
I think that Chrome had a bug that didn't allow to use Ctrl+S, but first of all you should test with other browsers because your code might not be correct if you're using the iframe.
When I was using a non
When I was using a non-CKEditor <textarea>, CTRL/CMD + S was working as intended on Chrome. So neither my event listener nor Chrome is the problem. But I see what you're saying. Is there a way not to use an iframe to hold the ckeditor?