Skip to content

Commit

Permalink
List View: Account for text fields in shortcut handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed May 10, 2024
1 parent 5915f9a commit 4cf4504
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/block-editor/src/components/list-view/block.js
Expand Up @@ -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
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit 4cf4504

Please sign in to comment.