@@ -38,9 +38,7 @@ function BlockListAppender( {
3838 if ( CustomAppender ) {
3939 // Prefer custom render prop if provided.
4040 appender = < CustomAppender /> ;
41- } else if ( canInsertDefaultBlock ) {
42- // Render the default block appender when renderAppender has not been
43- // provided and the context supports use of the default appender.
41+ } else {
4442 const isDocumentAppender = ! rootClientId ;
4543 const isParentSelected = selectedBlockClientId === rootClientId ;
4644 const isAnotherDefaultAppenderAlreadyDisplayed =
@@ -50,26 +48,31 @@ function BlockListAppender( {
5048 if (
5149 ! isDocumentAppender &&
5250 ! isParentSelected &&
53- isAnotherDefaultAppenderAlreadyDisplayed
51+ ( ! selectedBlockClientId ||
52+ isAnotherDefaultAppenderAlreadyDisplayed )
5453 ) {
5554 return null ;
5655 }
5756
58- appender = (
59- < DefaultBlockAppender
60- rootClientId = { rootClientId }
61- lastBlockClientId = { last ( blockClientIds ) }
62- />
63- ) ;
64- } else {
65- // Fallback in the case no renderAppender has been provided and the
66- // default block can't be inserted.
67- appender = (
68- < ButtonBlockAppender
69- rootClientId = { rootClientId }
70- className = "block-list-appender__toggle"
71- />
72- ) ;
57+ if ( canInsertDefaultBlock ) {
58+ // Render the default block appender when renderAppender has not been
59+ // provided and the context supports use of the default appender.
60+ appender = (
61+ < DefaultBlockAppender
62+ rootClientId = { rootClientId }
63+ lastBlockClientId = { last ( blockClientIds ) }
64+ />
65+ ) ;
66+ } else {
67+ // Fallback in the case no renderAppender has been provided and the
68+ // default block can't be inserted.
69+ appender = (
70+ < ButtonBlockAppender
71+ rootClientId = { rootClientId }
72+ className = "block-list-appender__toggle"
73+ />
74+ ) ;
75+ }
7376 }
7477
7578 return (
0 commit comments