Skip to content

Commit

Permalink
[RNMobile] Fix pasting text on Post Title (#16116)
Browse files Browse the repository at this point in the history
* Add onEnter prop to RichText to allow custom handling of onEnter

* Remove reduntant line
  • Loading branch information
etoledom authored Jun 12, 2019
1 parent 59ffb86 commit 2e83587
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ export class RichText extends Component {

// eslint-disable-next-line no-unused-vars
onEnter( event ) {
if ( this.props.onEnter ) {
this.props.onEnter();
return;
}

this.lastEventCount = event.nativeEvent.eventCount;
this.comesFromAztec = true;
this.firedAfterTextChanged = event.nativeEvent.firedAfterTextChanged;
Expand Down
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 @@ -102,7 +102,7 @@ class PostTitle extends Component {
placeholder={ decodedPlaceholder }
value={ title }
onSplit={ () => { } }
onReplace={ this.props.onEnterPress }
onEnter={ this.props.onEnterPress }
disableEditingMenu={ true }
setRef={ ( ref ) => {
this.titleViewRef = ref;
Expand Down

0 comments on commit 2e83587

Please sign in to comment.