Skip to content

Commit

Permalink
Editor: Apply IE11 input fix only when mounting TinyMCE (#12335)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored and youknowriad committed Nov 29, 2018
1 parent 57e4183 commit 99da50a
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions packages/editor/src/components/rich-text/tinymce.js
Expand Up @@ -259,17 +259,14 @@ export default class TinyMCE extends Component {
this.props.setRef( editorNode );
}

/**
* A ref function can be used for cleanup because React calls it with
* `null` when unmounting.
*/
if ( this.removeInternetExplorerInputFix ) {
this.removeInternetExplorerInputFix();
this.removeInternetExplorerInputFix = null;
}

if ( IS_IE ) {
this.removeInternetExplorerInputFix = applyInternetExplorerInputFix( editorNode );
if ( editorNode ) {
// Mounting:
this.removeInternetExplorerInputFix = applyInternetExplorerInputFix( editorNode );
} else {
// Unmounting:
this.removeInternetExplorerInputFix();
}
}
}

Expand Down

0 comments on commit 99da50a

Please sign in to comment.