I'm trying to implement an autosave feature in CKEditor 5, where a save only occurs if changes were made and after the editor has lost focus.
How could I do this? The documentation has been very confusing to me.
This is the closest I've gotten:
function onChange(el,editor) {
editor.document.once('change',function(evt,data) {
$(el).one('blur',function() {
saveFunction();
onChange(el,editor);
});
});
}
onChange(el,editor);
The problem with my solution is the blur event fires whenever CKEditor brings up a modal.