Skip to content

Commit

Permalink
Inserter: Fix subtle media insertion error (WordPress#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 <marco.ciampo@gmail.com>

* Reformat

---------

Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>

Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
  • Loading branch information
4 people committed 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.