diff --git a/CHANGES.md b/CHANGES.md index 86c9902e42f..aa7beb6a684 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,6 +26,7 @@ Fixed Issues: * [#12402](http://dev.ckeditor.com/ticket/12402): Fixed: Workaround for Blink's bug with `document.title` which breaks updating title in the full HTML mode. * [#12338](http://dev.ckeditor.com/ticket/12338): Fixed: CKEditor package contains unoptimised images. * [#12324](http://dev.ckeditor.com/ticket/12324): [IE8] Fixed: Undo steps not recorded when changing caret position by clicking below body. +* [#12332](http://dev.ckeditor.com/ticket/12332): Fixed: Lowered DOM events listeners' priorities in Undo Manager in order to avoid ambiguity. ## CKEditor 4.4.4 diff --git a/plugins/undo/plugin.js b/plugins/undo/plugin.js index 3fdfaf94aa6..f5b3e185e03 100644 --- a/plugins/undo/plugin.js +++ b/plugins/undo/plugin.js @@ -1055,18 +1055,18 @@ if ( UndoManager.ieFunctionalKeysBug( evt.data.getKey() ) ) { that.onInput(); } - } ); + }, null, null, 999 ); // Only IE can't use input event, because it's not fired in contenteditable. - editable.attachListener( editable, CKEDITOR.env.ie ? 'keypress' : 'input', that.onInput, that ); + editable.attachListener( editable, ( CKEDITOR.env.ie ? 'keypress' : 'input' ), that.onInput, that, null, 999 ); // Keyup executes main snapshot logic. - editable.attachListener( editable, 'keyup', that.onKeyup, that ); + editable.attachListener( editable, 'keyup', that.onKeyup, that, null, 999 ); // On paste and drop we need to ignore input event. // It would result with calling undoManager.type() on any following key. - editable.attachListener( editable, 'paste', that.ignoreInputEventListener, that ); - editable.attachListener( editable, 'drop', that.ignoreInputEventListener, that ); + editable.attachListener( editable, 'paste', that.ignoreInputEventListener, that, null, 999 ); + editable.attachListener( editable, 'drop', that.ignoreInputEventListener, that, null, 999 ); // Click should create a snapshot if needed, but shouldn't cause change event. // Don't pass onNavigationKey directly as a listener because it accepts one argument which @@ -1074,14 +1074,14 @@ // #12324 comment:4 editable.attachListener( editable.isInline() ? editable : editor.document.getDocumentElement(), 'click', function() { that.onNavigationKey(); - } ); + }, null, null, 999 ); // When pressing `Tab` key while editable is focused, `keyup` event is not fired. // Which means that record for `tab` key stays in key events stack. // We assume that when editor is blurred `tab` key is already up. editable.attachListener( this.undoManager.editor, 'blur', function() { that.keyEventsStack.remove( 9 /*Tab*/ ); - } ); + }, null, null, 999 ); } };