Skip to content

Commit

Permalink
Revert "Fix change event not fired on type after paste"
Browse files Browse the repository at this point in the history
This reverts commit 44bc308 as included in latest version.
  • Loading branch information
ajeety4 committed Mar 30, 2023
1 parent e93f6a7 commit 8ba91a8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
4 changes: 0 additions & 4 deletions plugins/undo/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1079,10 +1079,6 @@
// It would result with calling undoManager.type() on any following key.
editable.attachListener( editable, 'paste', that.ignoreInputEventListener, that, null, 999 );
editable.attachListener( editable, 'drop', that.ignoreInputEventListener, that, null, 999 );
// After paste we need to re-enable input event listener
editor.on('afterPaste', function () {
that.ignoreInputEvent = false;
});

// 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
Expand Down
22 changes: 1 addition & 21 deletions tests/plugins/undo/change.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* bender-tags: editor,unit */
/* bender-ckeditor-plugins: undo,clipboard,basicstyles,toolbar,wysiwygarea */
/* bender-ckeditor-plugins: undo,basicstyles,toolbar,wysiwygarea */
/* global undoEventDispatchTestsTools */

( function() {
Expand Down Expand Up @@ -180,26 +180,6 @@
// After setting text - caret is moved to beginning. We don't care - it does not change nothing.
keyTools.keyEvent( keyCodesEnum.LEFT, null, true );
} );
},

'test change event not fired on type after paste': function() {
this.editorBot.setHtmlWithSelection( '<p>foo^</p>' );

var that = this,
keys = this.keyTools.keyCodesEnum;

bender.tools.emulatePaste( this.editor, 'PASTE' );

this.editor.once( 'afterPaste', function() {
resume( function() {
changeCounter = 0;
that.checkChange( function() {
that.keyTools.keyEvent( keys.KEY_G );
} );
} );
} );

wait();
}
} );

Expand Down

0 comments on commit 8ba91a8

Please sign in to comment.