Skip to content

Commit

Permalink
Fix navigation end2end test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jun 7, 2021
1 parent 1fe5987 commit 8bb9a8d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/block-library/src/navigation/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,15 @@ export default compose( [
const selectedBlockHasDescendants = !! getClientIdsOfDescendants( [
selectedBlockId,
] )?.length;

return {
isImmediateParentOfSelectedBlock,
selectedBlockHasDescendants,
hasExistingNavItems: !! innerBlocks.length,

// This prop is already available but computing it here ensures it's
// fresh compared to isImmediateParentOfSelectedBlock
isSelected: selectedBlockId === clientId,
};
} ),
withDispatch( ( dispatch, { clientId } ) => {
Expand Down

0 comments on commit 8bb9a8d

Please sign in to comment.