Skip to content

Commit

Permalink
Fix the initial isActive state in mobile viewport
Browse files Browse the repository at this point in the history
The panel is always initially closed in mobile viewport
  • Loading branch information
WunderBart committed Jan 27, 2023
1 parent 72433a4 commit fd4c55d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/interface/src/components/complementary-area/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,17 @@ function ComplementaryArea( {
const { getActiveComplementaryArea, isItemPinned } =
select( interfaceStore );
const _activeArea = getActiveComplementaryArea( scope );
const _isSmall =
select( viewportStore ).isViewportMatch( '< medium' );

return {
isActive:
_activeArea === undefined
_activeArea === undefined && ! _isSmall
? undefined
: _activeArea === identifier,
isPinned: isItemPinned( scope, identifier ),
activeArea: _activeArea,
isSmall: select( viewportStore ).isViewportMatch( '< medium' ),
isSmall: _isSmall,
isLarge: select( viewportStore ).isViewportMatch( 'large' ),
};
},
Expand Down

0 comments on commit fd4c55d

Please sign in to comment.