Skip to content

Commit

Permalink
Allow Editable to have variable node name.
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Mar 29, 2017
1 parent 001ec39 commit a88c093
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blocks/components/editable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export default class Editable extends wp.element.Component {
}

render() {
return <div ref={ this.bindNode } />;
return wp.element.createElement( this.props.name, {
ref: this.bindNode
} );
}
}
1 change: 1 addition & 0 deletions editor/blocks/text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ wp.blocks.registerBlock( 'core/text', {
edit( attributes, onChange ) {
return (
<Editable
name="p"
value={ attributes.value }
onChange={ ( value ) => onChange( { value } ) }
/>
Expand Down

0 comments on commit a88c093

Please sign in to comment.