Skip to content

Commit

Permalink
Rename content attr to summaryContent
Browse files Browse the repository at this point in the history
  • Loading branch information
George Hotelling committed Aug 3, 2020
1 parent a1e07cf commit 732d593
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/details/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "boolean",
"default": false
},
"content": {
"summaryContent": {
"type": "string"
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/details/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export default ( {
<RichText
tagName="div"
className="block-library-details__pseudo-summary"
value={ attributes.content }
onChange={ ( content ) => setAttributes( { content } ) }
value={ attributes.summaryContent }
onChange={ ( summaryContent ) => setAttributes( { summaryContent } ) }
placeholder={ __( 'Write a summary…' ) }
aria-label={ __( 'Summary text' ) }
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/details/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { InnerBlocks, RichText } from '@wordpress/block-editor';
export default ( { attributes } ) => {
return (
<details open={ attributes.initialOpen }>
<RichText.Content tagName="summary" value={ attributes.content } />
<RichText.Content tagName="summary" value={ attributes.summaryContent } />
<InnerBlocks.Content />
</details>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/fixtures/blocks/core__details.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- wp:core/details {"content": "This is the summary ", "initialOpen": false} -->
<!-- wp:core/details {"summaryContent": "This is the summary ", "initialOpen": false} -->
<details class="wp-block-details">
<summary>This is the summary </summary>
<!-- wp:heading -->
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/fixtures/blocks/core__details.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"isValid": true,
"attributes": {
"initialOpen": false,
"content": "This is the summary "
"summaryContent": "This is the summary "
},
"innerBlocks": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"blockName": "core/details",
"attrs": {
"content": "This is the summary ",
"summaryContent": "This is the summary ",
"initialOpen": false
},
"innerBlocks": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- wp:details {"content":"This is the summary "} -->
<!-- wp:details {"summaryContent":"This is the summary "} -->
<details class="wp-block-details"><summary>This is the summary </summary><!-- wp:heading -->
<h2>More here</h2>
<!-- /wp:heading -->
Expand Down

0 comments on commit 732d593

Please sign in to comment.