Skip to content

Commit

Permalink
Page Content Focus: Switch to Page panel when deselecting a block (#5…
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks authored and tellthemachines committed Jun 27, 2023
1 parent ac3de89 commit fb8efb9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/edit-site/src/components/sidebar-edit-mode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ export function SidebarComplementaryAreaFills() {
useEffect( () => {
// Don't automatically switch tab when the sidebar is closed or when we
// are focused on page content.
if ( ! isEditorSidebarOpened || hasPageContentFocus ) {
if ( ! isEditorSidebarOpened ) {
return;
}
if ( hasBlockSelection ) {
enableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );
if ( ! hasPageContentFocus ) {
enableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );
}
} else {
enableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );
}
Expand Down

0 comments on commit fb8efb9

Please sign in to comment.