Block Directory: useMemo on Suggestions never triggers look up in block directory #21069
Labels
[Feature] Inserter
The main way to insert blocks using the + button in the editing interface
[Type] Regression
Related to a regression in the latest release
Describe the bug
The block editor inserter menu was recently refactored and
useMemo
was used to wrap the suggestion list. By doing so, it ensures that it will never return an empty list (there may be some cases where it doesn't have suggestions but the general use case has them). This is problematic because the__experimentalInserterMenuExtension.Slot
expects the list to at some point be empty to show theNo blocks found
copy and also as the queue to search in the block directory.Introduced in: #20880
The Memoized list
gutenberg/packages/block-editor/src/components/inserter/block-list.js
Line 209 in b16542e
The calculation of
hasItems
gutenberg/packages/block-editor/src/components/inserter/block-list.js
Line 326 in b16542e
The check in the menu slot
gutenberg/packages/block-editor/src/components/inserter/block-list.js
Line 446 in b16542e
To reproduce
Steps to reproduce the behavior:
Expected behavior
The
hasItems
boolean needs to come back false so we can check for plugins in the block directory.Additional context
Master@
b16542eThe text was updated successfully, but these errors were encountered: