Skip to content

Commit

Permalink
Revert "Remove the call that does blur the undelying native compone…
Browse files Browse the repository at this point in the history
…nt when deselecting RichText or PlainText. (#12886)"

This reverts commit d9fe45e.
  • Loading branch information
pinarol committed Dec 17, 2018
1 parent d9fe45e commit e65ee76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/editor/src/components/plain-text/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ export default class PlainText extends Component {
}
}

componentDidUpdate( prevProps ) {
if ( ! this.props.isSelected && prevProps.isSelected ) {
this._input.blur();
}
}

focus() {
this._input.focus();
}
Expand Down
2 changes: 2 additions & 0 deletions packages/editor/src/components/rich-text/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ export class RichText extends Component {
componentDidUpdate( prevProps ) {
if ( this.props.isSelected && ! prevProps.isSelected ) {
this._editor.focus();
} else if ( ! this.props.isSelected && prevProps.isSelected ) {
this._editor.blur();
}
}

Expand Down

0 comments on commit e65ee76

Please sign in to comment.