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 2, 2020
1 parent 77e32a9 commit a0ae203
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 a0ae203

Please sign in to comment.