Skip to content

Commit

Permalink
Fix composite bug
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jul 13, 2020
1 parent ee899f9 commit c682202
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ function BlockTypesList( {
} ) {
const composite = useCompositeState();
const normalizedItems = includeVariationsInInserterItems( items );
const orderId = normalizedItems.reduce(
( acc, item ) => acc + '--' + item.id,
''
);

return (
/*
Expand All @@ -36,6 +40,8 @@ function BlockTypesList( {
{ ...composite }
className="block-editor-block-types-list"
aria-label={ label }
// This ensures the composite state refreshes when the list order changes.
key={ orderId }
>
{ normalizedItems.map( ( item ) => {
return (
Expand Down

0 comments on commit c682202

Please sign in to comment.