Skip to content

Commit

Permalink
Navigation Screen: Hide sidebar menu isn't selected (#32090)
Browse files Browse the repository at this point in the history
* Fix the visual glitch
  • Loading branch information
Mamaduka authored May 25, 2021
1 parent 0616cf0 commit 10b6189
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/edit-navigation/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function Layout( { blockEditorSettings } ) {
useMenuNotifications( selectedMenuId );

const hasMenus = !! menus?.length;
const hasPermanentSidebar = isLargeViewport && hasMenus;
const hasPermanentSidebar = isLargeViewport && isMenuSelected;

const isBlockEditorReady = !! (
hasMenus &&
Expand Down Expand Up @@ -183,14 +183,16 @@ export default function Layout( { blockEditorSettings } ) {
)
}
/>
<Sidebar
onSelectMenu={ selectMenu }
menus={ menus }
menuId={ selectedMenuId }
onDeleteMenu={ deleteMenu }
isMenuBeingDeleted={ isMenuBeingDeleted }
hasPermanentSidebar={ hasPermanentSidebar }
/>
{ isMenuSelected && (
<Sidebar
menus={ menus }
menuId={ selectedMenuId }
onSelectMenu={ selectMenu }
onDeleteMenu={ deleteMenu }
isMenuBeingDeleted={ isMenuBeingDeleted }
hasPermanentSidebar={ hasPermanentSidebar }
/>
) }
</IsMenuNameControlFocusedContext.Provider>
<UnsavedChangesWarning />
</BlockEditorProvider>
Expand Down

0 comments on commit 10b6189

Please sign in to comment.