Skip to content

Commit

Permalink
Fix focus loss happening when installing blocks from the directory (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored and adamziel committed Apr 19, 2022
1 parent 09e53d7 commit d6b76fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ function DownloadableBlockListItem( { composite, item, onClick } ) {

return (
<CompositeItem
__experimentalIsFocusable
role="option"
as={ Button }
{ ...composite }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ describe( 'DownloadableBlockListItem', () => {
<DownloadableBlockListItem onClick={ jest.fn() } item={ plugin } />
);
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' );
} );

Expand Down

0 comments on commit d6b76fe

Please sign in to comment.