Skip to content

Commit

Permalink
check max nesting level for the currently selected submenu block
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Draganescu authored and draganescu committed Apr 1, 2022
1 parent 9541e7f commit c1c4b1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-library/src/navigation-submenu/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ export default function NavigationSubmenuEdit( {

return {
isAtMaxNesting:
getBlockParentsByBlockName( clientId, name ).length >=
maxNestingLevel,
getBlockParentsByBlockName( selectedBlockId, name )
.length >= maxNestingLevel,
isTopLevelItem:
getBlockParentsByBlockName( clientId, name ).length === 0,
isParentOfSelectedBlock: hasSelectedInnerBlock(
Expand Down

0 comments on commit c1c4b1a

Please sign in to comment.