diff --git a/packages/block-library/src/classic/edit.js b/packages/block-library/src/classic/edit.js index 5267696685288..d820517cd1bd5 100644 --- a/packages/block-library/src/classic/edit.js +++ b/packages/block-library/src/classic/edit.js @@ -8,7 +8,7 @@ import { debounce } from 'lodash'; */ import { Component } from '@wordpress/element'; import { __, _x } from '@wordpress/i18n'; -import { BACKSPACE, DELETE, F10 } from '@wordpress/keycodes'; +import { BACKSPACE, DELETE, F10, isKeyboardEvent } from '@wordpress/keycodes'; const { wp } = window; @@ -136,6 +136,11 @@ export default class ClassicEdit extends Component { ); editor.on( 'keydown', ( event ) => { + if ( isKeyboardEvent.primary( event, 'z' ) ) { + // Prevent the gutenberg undo kicking in so TinyMCE undo stack works as expected + event.stopPropagation(); + } + if ( ( event.keyCode === BACKSPACE || event.keyCode === DELETE ) && isTmceEmpty( editor )