From 4cf4504dfb209635ec623393b5de0f5f1ed6589c Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Fri, 10 May 2024 22:18:17 +0400 Subject: [PATCH] List View: Account for text fields in shortcut handler --- packages/block-editor/src/components/list-view/block.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/block-editor/src/components/list-view/block.js b/packages/block-editor/src/components/list-view/block.js index b9d4c6c438c569..2f6c7516da3bfc 100644 --- a/packages/block-editor/src/components/list-view/block.js +++ b/packages/block-editor/src/components/list-view/block.js @@ -30,6 +30,7 @@ import { BACKSPACE, DELETE } from '@wordpress/keycodes'; import isShallowEqual from '@wordpress/is-shallow-equal'; import { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts'; import { speak } from '@wordpress/a11y'; +import { isTextField } from '@wordpress/dom'; /** * Internal dependencies @@ -181,6 +182,11 @@ function ListViewBlock( { return; } + // Retain the default behavior for text fields. + if ( isTextField( event.target ) ) { + return; + } + // If multiple blocks are selected, deselect all blocks when the user // presses the escape key. if (