Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove the custom appender from the navigation block
  • Loading branch information
youknowriad committed Jun 4, 2021
commit c9fd4a5c57e2590486d73e967cd1934bb55b0cc1
25 changes: 0 additions & 25 deletions packages/block-library/src/navigation/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import classnames from 'classnames';
*/
import { useState, useMemo } from '@wordpress/element';
import {
InnerBlocks,
__experimentalUseInnerBlocksProps as useInnerBlocksProps,
InspectorControls,
JustifyToolbar,
Expand Down Expand Up @@ -44,13 +43,10 @@ const LAYOUT = {
};

function Navigation( {
selectedBlockHasDescendants,
attributes,
setAttributes,
clientId,
hasExistingNavItems,
isImmediateParentOfSelectedBlock,
isSelected,
updateInnerBlocks,
className,
hasSubmenuIndicatorSetting = true,
Expand Down Expand Up @@ -86,12 +82,6 @@ function Navigation( {
{
allowedBlocks: ALLOWED_BLOCKS,
orientation: attributes.orientation || 'horizontal',
renderAppender:
( isImmediateParentOfSelectedBlock &&
! selectedBlockHasDescendants ) ||
isSelected
? InnerBlocks.DefaultAppender
: false,
__experimentalAppenderTagName: 'li',
__experimentalCaptureToolbars: true,
// Template lock set to false here so that the Nav
Expand Down Expand Up @@ -184,22 +174,7 @@ function Navigation( {
export default compose( [
withSelect( ( select, { clientId } ) => {
const innerBlocks = select( blockEditorStore ).getBlocks( clientId );
const {
getClientIdsOfDescendants,
hasSelectedInnerBlock,
getSelectedBlockClientId,
} = select( blockEditorStore );
const isImmediateParentOfSelectedBlock = hasSelectedInnerBlock(
clientId,
false
);
const selectedBlockId = getSelectedBlockClientId();
const selectedBlockHasDescendants = !! getClientIdsOfDescendants( [
selectedBlockId,
] )?.length;
return {
isImmediateParentOfSelectedBlock,
selectedBlockHasDescendants,
hasExistingNavItems: !! innerBlocks.length,
};
} ),
Expand Down