From bcee34e18661c253a18f6c3e28d456748cfafba4 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 14 Apr 2022 09:39:01 +0100 Subject: [PATCH] Fix focus loss happening when installing blocks from the directory --- .../src/components/downloadable-block-list-item/index.js | 1 + .../src/components/downloadable-block-list-item/test/index.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-directory/src/components/downloadable-block-list-item/index.js b/packages/block-directory/src/components/downloadable-block-list-item/index.js index 0d63cc3bcbc2d8..b434da9ad1c8af 100644 --- a/packages/block-directory/src/components/downloadable-block-list-item/index.js +++ b/packages/block-directory/src/components/downloadable-block-list-item/index.js @@ -93,6 +93,7 @@ function DownloadableBlockListItem( { composite, item, onClick } ) { return ( { ); const button = getByRole( 'option' ); - expect( button.disabled ).toBe( true ); + // Keeping it false to avoid focus loss and disable it using aria-disabled. + expect( button.disabled ).toBe( false ); expect( button.getAttribute( 'aria-disabled' ) ).toBe( 'true' ); } );