From 75c54c5e2a0c524a154cdaf3984fde4e027fcbfd Mon Sep 17 00:00:00 2001 From: Martijn van der Klis Date: Thu, 18 Apr 2024 14:21:51 +0200 Subject: [PATCH] Prevents delete key from undoing automatic changes --- .../src/components/rich-text/use-undo-automatic-change.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/block-editor/src/components/rich-text/use-undo-automatic-change.js b/packages/block-editor/src/components/rich-text/use-undo-automatic-change.js index 819f2935806263..9094633186ebdd 100644 --- a/packages/block-editor/src/components/rich-text/use-undo-automatic-change.js +++ b/packages/block-editor/src/components/rich-text/use-undo-automatic-change.js @@ -3,7 +3,7 @@ */ import { useSelect } from '@wordpress/data'; import { useRefEffect } from '@wordpress/compose'; -import { BACKSPACE, DELETE, ESCAPE } from '@wordpress/keycodes'; +import { BACKSPACE, ESCAPE } from '@wordpress/keycodes'; /** * Internal dependencies @@ -20,11 +20,7 @@ export function useUndoAutomaticChange() { return; } - if ( - keyCode !== DELETE && - keyCode !== BACKSPACE && - keyCode !== ESCAPE - ) { + if ( keyCode !== BACKSPACE && keyCode !== ESCAPE ) { return; }