Open draganescu opened 9 months ago
I was also able to reproduce this problem. Perhaps all the blocks inside the Post Template block will not have inspector UI displayed if there is no result of the loop. However, only block variations and block styles seem to be displayed.
My guess is that the underlying problem is that the block itself is not rendered to the canvas if there are no query results. Each block should have inserted its content into a slot via an InspectorControl
within the Edit component or a BlockEdit
hook. If the block itself, the Edit component, is not rendered, then the InspectorControl
itself is not rendered either.
Yeah I am not sure how to approach this best, I don't think it's a bug, but more a UI quick we need to account for.
This behaviour also appears when you have no published posts in your install. Create a fresh install and remove the "Hello world!" post. If you then try to edit a query loop, this happens.
But shouldn't it be possible anyway to work with the blocks there to use as placeholders, even if no content is present?
Description
If you have a title in a post content block in a query loop, but the query has no results, and you select the post title in the list view, the inspector does not show any of the block’s controls, not does the block toolbar.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
https://github.com/WordPress/gutenberg/assets/107534/bf87e084-cd48-4a74-b87e-0145b3329c86
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes