Skip to content
Permalink
Browse files

Uses cloneDeep from lodash when cloning a block in wp.blocks.cloneBlo…

…ck function.
  • Loading branch information...
avillegasn committed Jan 24, 2019
1 parent 0259f7b commit 51c1c0d38901d59d0b028bc26163fe0d61a7c105
Showing with 3 additions and 2 deletions.
  1. +3 −2 packages/blocks/src/api/factory.js
@@ -6,6 +6,7 @@ import {
every,
reduce,
castArray,
cloneDeep,
findIndex,
isObjectLike,
filter,
@@ -94,8 +95,8 @@ export function cloneBlock( block, mergeAttributes = {}, newInnerBlocks ) {
...block,
clientId,
attributes: {
...block.attributes,
...mergeAttributes,
...cloneDeep( block.attributes ),
...cloneDeep( mergeAttributes ),
},
innerBlocks: newInnerBlocks ||
block.innerBlocks.map( ( innerBlock ) => cloneBlock( innerBlock ) ),

0 comments on commit 51c1c0d

Please sign in to comment.
You can’t perform that action at this time.