Skip to content

Commit

Permalink
Don't display default appender inside Manual grid. (WordPress#63395)
Browse files Browse the repository at this point in the history
Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org>
Co-authored-by: noisysocks <noisysocks@git.wordpress.org>
  • Loading branch information
3 people authored and carstingaxion committed Jul 18, 2024
1 parent 4497cc5 commit a666d6b
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ import { store as blockEditorStore } from '../../store';
export const ZWNBSP = '\ufeff';

export default function DefaultBlockAppender( { rootClientId } ) {
const { showPrompt, isLocked, placeholder } = useSelect(
const { showPrompt, isLocked, placeholder, isManualGrid } = useSelect(
( select ) => {
const { getBlockCount, getSettings, getTemplateLock } =
select( blockEditorStore );
const {
getBlockCount,
getSettings,
getTemplateLock,
getBlockAttributes,
} = select( blockEditorStore );

const isEmpty = ! getBlockCount( rootClientId );
const { bodyPlaceholder } = getSettings();
Expand All @@ -36,14 +40,17 @@ export default function DefaultBlockAppender( { rootClientId } ) {
showPrompt: isEmpty,
isLocked: !! getTemplateLock( rootClientId ),
placeholder: bodyPlaceholder,
isManualGrid:
getBlockAttributes( rootClientId )?.layout
?.isManualPlacement,
};
},
[ rootClientId ]
);

const { insertDefaultBlock, startTyping } = useDispatch( blockEditorStore );

if ( isLocked ) {
if ( isLocked || isManualGrid ) {
return null;
}

Expand Down

0 comments on commit a666d6b

Please sign in to comment.