Skip to content

Commit

Permalink
only resize above the tablet breakpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Aug 14, 2023
1 parent d31c538 commit d10e813
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/block-editor/src/components/block-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ export default function BlockTools( {
moveBlocksDown,
} = useDispatch( blockEditorStore );

const isLargerThanTabletViewport = useViewportMatch( 'medium', '>' );

useLayoutEffect( () => {
// don't do anything if not fixed toolbar
if ( ! hasFixedToolbar ) {
if ( ! hasFixedToolbar || ! isLargerThanTabletViewport ) {
return;
}

Expand Down Expand Up @@ -109,7 +111,7 @@ export default function BlockTools( {
).style.width = `calc(100% - ${
leftHeaderWidth + pinnedItemsWidth + marginLeft
}px)`;
}, [ hasFixedToolbar ] );
}, [ hasFixedToolbar, isLargerThanTabletViewport ] );

function onKeyDown( event ) {
if ( event.defaultPrevented ) return;
Expand Down

0 comments on commit d10e813

Please sign in to comment.