Skip to content

Commit

Permalink
Implement setRef for post-title in Gutenberg Mobile. (#13874)
Browse files Browse the repository at this point in the history
* WIP

* Rolls back the changes to PostTitle.

* Implements setRef for post-title.
  • Loading branch information
diegoreymendez authored and youknowriad committed Mar 6, 2019
1 parent 919ec72 commit 4a93f5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/editor/src/components/post-title/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class PostTitle extends Component {
return (
<RichText
tagName={ 'p' }
rootTagsToEliminate={ [ 'strong' ] }
onFocus={ this.onSelect }
onBlur={ this.props.onBlur } // always assign onBlur as a props
multiline={ false }
Expand All @@ -66,6 +65,7 @@ class PostTitle extends Component {
placeholder={ decodedPlaceholder }
value={ title }
onSplit={ this.props.onEnterPress }
setRef={ this.props.setRef }
>
</RichText>
);
Expand Down
4 changes: 4 additions & 0 deletions packages/editor/src/components/rich-text/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ export class RichText extends Component {
<RCTAztecView
ref={ ( ref ) => {
this._editor = ref;

if ( this.props.setRef ) {
this.props.setRef( ref );
}
}
}
text={ { text: html, eventCount: this.lastEventCount } }
Expand Down

0 comments on commit 4a93f5d

Please sign in to comment.