Tree Select Control: Use enter button for selection (#41480)

* enable enter to select

* Add changefile(s) from automation for the following project(s): @woocommerce/components

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Paul Sealock 2023-11-17 10:07:01 +13:00 committed by GitHub
parent 251812232d
commit 3c703d3718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Improve keyboard interaction of Tree Select Control component.

View File

@ -331,6 +331,11 @@ const TreeSelectControl = ( {
if ( ENTER === event.key ) {
setTreeVisible( true );
if ( event.target.type === 'checkbox' ) {
event.target.click();
}
event.preventDefault();
}