Skip to content

Commit

Permalink
[RN mobile] pass isSelected to RichText components (#11857)
Browse files Browse the repository at this point in the history
* adds prop isSelected on RCTAztecView in RichText, copying value from passed props

* adding isSelected prop to Heading block to handle focus in native

* adding isSelected prop to Paragraph block to handle focus in native

* fixed lint warnings
  • Loading branch information
mzorz committed Nov 15, 2018
1 parent 0604cd0 commit db84d19
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/heading/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class HeadingEdit extends Component {
} = attributes;

const tagName = 'h' + level;

return (
<View>
<BlockControls>
Expand All @@ -48,6 +47,7 @@ class HeadingEdit extends Component {
<RichText
tagName={ tagName }
value={ content }
isSelected={ this.props.isSelected }
style={ {
minHeight: Math.max( minHeight, typeof attributes.aztecHeight === 'undefined' ? 0 : attributes.aztecHeight ),
} }
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/paragraph/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class ParagraphEdit extends Component {
<RichText
tagName="p"
value={ content }
isSelected={ this.props.isSelected }
style={ {
...style,
minHeight: Math.max( minHeight, typeof attributes.aztecHeight === 'undefined' ? 0 : attributes.aztecHeight ),
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/components/rich-text/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ export class RichText extends Component {
onBackspace={ this.onBackspace }
onContentSizeChange={ this.onContentSizeChange }
onActiveFormatsChange={ this.onActiveFormatsChange }
isSelected={ this.props.isSelected }
color={ 'black' }
maxImagesWidth={ 200 }
style={ style }
Expand Down

0 comments on commit db84d19

Please sign in to comment.