Skip to content

Commit

Permalink
Fixed a bug that List block attributes were reset in 6.1.1 (#46000)
Browse files Browse the repository at this point in the history
* fix #45987

* Fix variable name
  • Loading branch information
ddryo authored Nov 25, 2022
1 parent cf3cbd8 commit 9aff35e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/block-library/src/list/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export function createListBlockFromDOMElement( listElement ) {
}

export function migrateToListV2( attributes ) {
const { values, start, reversed, ordered, type } = attributes;
const { values, start, reversed, ordered, type, ...otherAttributes } =
attributes;

const list = document.createElement( ordered ? 'ol' : 'ul' );
list.innerHTML = values;
Expand All @@ -72,5 +73,8 @@ export function migrateToListV2( attributes ) {

const [ listBlock ] = rawHandler( { HTML: list.outerHTML } );

return [ listBlock.attributes, listBlock.innerBlocks ];
return [
{ ...otherAttributes, ...listBlock.attributes },
listBlock.innerBlocks,
];
}

0 comments on commit 9aff35e

Please sign in to comment.