-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Inserter: Incorrect available inner blocks in inserter #24402
Comments
I believe this is not a bug, this is the intended behavior of the global inserter because it inserts blocks after the selected block and the only possible block to be inserted after a column, is another column :) So I think we should close this issue and focus on #24403 instead. |
The global inserter always works that way. you can't make a difference in its content between a "paragraph" block being selected and "columns" (container) block being selected otherwise it becomes confusing.
I think the behavior of the global inserter is correct but the issue you raised is just a consequence of #24403 |
I agree with focusing on #24403. It's possible that addressing that issue may improve this. The behavior of the global inserter may be correct from a technical perspective, especially for someone with deep technical familiarity with the inserter and appender. I don't have that deep understanding 🙂 I have a hard time imagining that a user would want or expect to be presented a Column block when following the steps I've described. Consider this flow, where we have a different set of inner blocks that are only valid children of a specific parent. When we go to append to a Column and "Browse all," we're presented with children of the other block. Shouldn't the global inserter use the appender's location to determine the block it presents? |
the global inserter is its own piece of UI independent of the presence of the appender or other inserters on the page, it can only rely on the state of the block editor to dictate its behavior. Right now (and from the very first day of Gutenberg), the behavior has always been: insert after the selected block. We can of course think of different rules here but these rules should be consistent and they shouldn't depend on the presence of other UI elements on the page. |
insert after the selected block also means: populate the block inserter with the blocks that can be inserted inside the direct container of the selected block. |
It sounds like this is where the confusion and challenge come from. The presence of the appender implies there are no blocks in the column, therefore the inserter has nothing to insert after. |
There are no blocks inside the "column" block but there are blocks inside the "columns" block (aka the selected column block) |
My 2 cents. I feel this is a really bad UI -- it's super confusing! What else is the user supposed to do? You can't expect the user to search blocks by name at first because they won't remember/know all. Of course they are going to click "Browse All" expecting to see what blocks can be inserted in the column. The old appender (prior to 5.5) worked so much better. I think this new UI works well in the context of adding content to a post, but horribly in the context of inner blocks. |
Is there a filter to show more than 6 blocks (like in block variations, which show all variations available)? Then I can hide the "Browse All" with CSS. |
I have to agree with all the comments above saying that the global inserter's behaviour is extremely confusing. It makes no sense to ask the user to click on "Browse All" to find out that he won't be inserting the block in the same place as if he'd used the quick inserter... |
Yes. I'm using 5.5.1 and 9.0, and it's still there. It's hard to notice with core blocks, but the appender button + clicking on Browse All shows the available blocks for the parent block, not the inner block group. In my photo, the parent inner block is template locked, and when I click on the inner block inserter inside this parent block, it doesn't show me the available blocks. |
I explained the issue in more detail in #25718. |
@rebeccahum I reproduced this bug doing the following:
What I would expect is for the social icons to show up in the block directory, but instead the regular core blocks show. I find this very confusing. I have WordPress 5.5.1 installed, as well as Gutenberg 9.1.1. No other plugins are installed. |
Got it, I'm able to reproduce now — so you're expecting the child blocks to show up under "Browse All". |
Yes. The issue seems to be related to the way the global inserter works, as @youknowriad said above. This issue with the global inserter also applies to #24403 and #26046, and extends to block patterns in #26281. I believe the root problem of all of these issues is the way the global inserter. |
This should be fixed now that #24403 has been solved, so closing. If anyone can still reproduce then would be happy to reopen. |
The available blocks in the main inserter may be inaccurate when using the following steps:
This manifests with blocks like Columns that have an expected structure (Columns -> Column -> Arbitrary blocks). Only the Column block is available, rather than the arbitrary blocks expected at the appender location.
Visual flow
Add a Column and select it
Click the + appender in the Column
Click "Browse all"
Only the Column block is available.
Editor version:
Related: #24403
The text was updated successfully, but these errors were encountered: