Skip to content

Commit

Permalink
RichText: Fix React warning shown when unmounting a currently selecte…
Browse files Browse the repository at this point in the history
…d RichText. (#12817)
  • Loading branch information
youknowriad committed Dec 12, 2018
1 parent e9187cf commit f71fb98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/editor/src/components/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ export class RichText extends Component {
this.lastHistoryValue = value;
}

componentWillUnmount() {
document.removeEventListener( 'selectionchange', this.onSelectionChange );
}

setRef( node ) {
this.editableRef = node;
}
Expand Down

0 comments on commit f71fb98

Please sign in to comment.