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 committed Mar 12, 2022
1 parent a72d135 commit 6416d72
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 6416d72

Please sign in to comment.