Skip to content

Commit

Permalink
Display trailing inserter when parent block is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
jeyip committed Aug 28, 2020
1 parent 97d9cea commit f12cb55
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,18 @@ function BlockListAppender( {
// Render the default block appender when renderAppender has not been
// provided and the context supports use of the default appender.
const isDocumentAppender = ! rootClientId;
const isParentSelected = selectedBlockClientId !== rootClientId;
const isAnotherDefaultAppenderAlreadyDisplayed =
selectedBlockClientId &&
! blockClientIds.includes( selectedBlockClientId );

if ( ! isDocumentAppender && isAnotherDefaultAppenderAlreadyDisplayed )
if (
! isDocumentAppender &&
! isParentSelected &&
isAnotherDefaultAppenderAlreadyDisplayed
) {
return null;
}

appender = (
<DefaultBlockAppender
Expand Down

0 comments on commit f12cb55

Please sign in to comment.