-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group Block: Allow blocks to be dragged onto it in its placeholder state #49361
Group Block: Allow blocks to be dragged onto it in its placeholder state #49361
Conversation
Size Change: +11 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well, and code looks good to me. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the speedy reviews and for merging this in! 🙇 |
Oh, just realised I accidentally removed the |
What?
Fixes #49256
Allow dragging blocks into the Group block within its placeholder state.
Why?
As raised in #49256 (comment), prior to this PR, it isn't possible to drag blocks into the Group block within its placeholder state. It turns out this is because in the placeholder state the children of
useInnerBlocksProps
are not rendered (InnerBlocks
), which means that theblockListSettings
list is not updated to include the Group block, so it isn't considered as being allowed to receive child blocks.How?
View
with theinnerBlocksProps
applied there, and{ innerBlocksProps.children }
is explicitly output (introduced in Paste: reuse file transforms for file pasting #45891).renderAppender
value passed touseInnerBlocksProps
is updated so that it's explicitly set tofalse
when in the placeholder state. I've added some comments to explain each value, since it wasn't obvious to me at first what the difference betweenfalse
andundefined
would be.Testing Instructions
Screenshots or screencast