Skip to content

Commit

Permalink
Make sure RichText resigns focus when unmounted (#13048)
Browse files Browse the repository at this point in the history
  • Loading branch information
koke authored Dec 20, 2018
1 parent 49bb394 commit 96a73c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/editor/src/components/rich-text/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ export class RichText extends Component {
}
}

componentWillUnmount() {
if ( this._editor.isFocused() ) {
this._editor.blur();
}
}

componentDidUpdate( prevProps ) {
if ( this.props.isSelected && ! prevProps.isSelected ) {
this._editor.focus();
Expand Down

0 comments on commit 96a73c5

Please sign in to comment.