-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Child blocks are displayed in the block inserter and block visibility doesn't work #65687
Comments
Thanks for catching the bug and creating the issue. It seems the new behavior to "compute insertion point" on the fly should only apply to specific conditions, not all the conditions of when a block is visible or not. So it's like we need two different kind of selectors:
I'll explore something. |
We should have e2e tests about the "manage block visibility" thing |
I think the #65700 only partially resolved the issue.
This one remains. All child blocks are visible for the default root. The child blocks are no longer displayed when I select any container block, which causes a somewhat expensive re-render. ScreencastCleanShot.2024-11-05.at.17.35.01.mp4 |
This is indeed a strange behavior. However, I remember that there was an effort to show all blocks in #62169. Should all blocks, including children, be shown in a container block? |
After #62169, you see all blocks in the inserter. When container sets allow children, they're displayed at the top, followed by the remaining blocks. Click on rest (non-allowed in the container) blocks; insert those after the container. I think the current behavior for the default root ID ( @ellatrix, @youknowriad, what do you think? |
I agree, that ideally child blocks should only appear if you're within the parent (not necessarily directly, but at least it's an ancestor to the current selection) |
Should I re-open this issue or create a new one? |
Let's reopen it. |
I just noticed that the behavior of the inserter items is broken for every I'll prioritize working on a fix for this bug. |
This bug caused confusion in the latest WordPress speed build 😬 |
Instead of hiding blocks that can't be inserted at that level, what if we leave the block visible and add the necessary wrapping blocks to insert it? So, if someone selects |
That's a decent idea but IMO, we don't know enough to make the right call. While it can work for "column" and "block". I don't see anyone inserting "query pagination" and having a "query" around it or something like that. |
Good point. But for other blocks it could be really helpful, like "Instagram" could add the social icons wrapping block for it. Otherwise you have to know to search for "social icons" first. That said, this may guide you to even less of an understanding of how it works. You may end up with a different social icons block for each icon 😅 |
What problem does this address?
I found two issues in the trunk:
I used
git bisect
and it looks like this issue occurred in #65490.957141419a3cef7be97099ce0c69e8f8.mp4
cc @youknowriad @andrewserong @jorgefilipecosta
The text was updated successfully, but these errors were encountered: