Skip to content

Commit

Permalink
Inserter: Fix subtle media insertion error (#65057)
Browse files Browse the repository at this point in the history
* Inserter: Fix subtle media insertion error

* Remove unnecessary ref optional chaining

Co-authored-by: Marco Ciampini <[email protected]>

* Reformat

---------

Co-authored-by: Marco Ciampini <[email protected]>

Co-authored-by: tyxla <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
4 people authored Sep 4, 2024
1 parent 633e298 commit 626c3fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ function InserterMenu(
window.requestAnimationFrame( () => {
if (
! shouldFocusBlock &&
! blockTypesTabRef?.current.contains(
! blockTypesTabRef.current?.contains(
ref.current.ownerDocument.activeElement
)
) {
// There has been a focus loss, so focus the first button in the block types tab
blockTypesTabRef?.current.querySelector( 'button' ).focus();
blockTypesTabRef.current?.querySelector( 'button' ).focus();
}
} );
},
Expand Down

0 comments on commit 626c3fa

Please sign in to comment.