Skip to content

Commit

Permalink
Prevents delete key from undoing automatic changes (#60858)
Browse files Browse the repository at this point in the history
Co-authored-by: mhkuu <[email protected]>
Co-authored-by: ellatrix <[email protected]>
Co-authored-by: tomalec <[email protected]>
  • Loading branch information
4 people authored Apr 19, 2024
1 parent 42947ce commit 9912c11
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,11 +20,7 @@ export function useUndoAutomaticChange() {
return;
}

if (
keyCode !== DELETE &&
keyCode !== BACKSPACE &&
keyCode !== ESCAPE
) {
if ( keyCode !== BACKSPACE && keyCode !== ESCAPE ) {
return;
}

Expand Down

1 comment on commit 9912c11

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 9912c11.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8750674385
📝 Reported issues:

Please sign in to comment.