From 4bf2666074febca4ef7d3236d96dd000ab5175ef Mon Sep 17 00:00:00 2001 From: BE-Webdesign Date: Thu, 27 Apr 2017 13:19:31 -0400 Subject: [PATCH] Add missing method to list block. The list block does not have an on change set for it and is expected to causing errors and no updating of the block attribute state. This PR copies the current implementation from a text block and enters it into the list block. --- blocks/library/list/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/blocks/library/list/index.js b/blocks/library/list/index.js index c197b6a5bff542..940db05a979f25 100644 --- a/blocks/library/list/index.js +++ b/blocks/library/list/index.js @@ -54,18 +54,27 @@ registerBlock( 'core/list', { } ], - edit( { attributes, focus, setFocus } ) { + edit( { attributes, setAttributes, focus, setFocus } ) { const { nodeName = 'OL', items = [], align } = attributes; const content = items.map( ( item, i ) => { return
  • { item.value }
  • ; } ); + const itemsFromContent = ( listContents ) => { + return listContents.map( ( listContent ) => ( { value: listContent.props.children } ) ); + }; + return ( { + setAttributes( { + items: itemsFromContent( nextContent ) + } ); + } } onFocus={ setFocus } className="blocks-list" /> );