Skip to content

Commit

Permalink
Remove isMounted from TextField
Browse files Browse the repository at this point in the history
  • Loading branch information
newoga committed Feb 23, 2016
1 parent ef90ecc commit eafda4b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/TextField/TextField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,20 @@ const TextField = React.createClass({
},

blur() {
if (this.isMounted()) this._getInputNode().blur();
if (this.input) this._getInputNode().blur();
},

focus() {
if (this.isMounted()) this._getInputNode().focus();
if (this.input) this._getInputNode().focus();
},

getValue() {
return this.isMounted() ? this._getInputNode().value : undefined;
return this.input ? this._getInputNode().value : undefined;
},

_getInputNode() {
return (this.props.children || this.props.multiLine) ?
this.refs.input.getInputNode() : ReactDOM.findDOMNode(this.refs.input);
this.input.getInputNode() : ReactDOM.findDOMNode(this.input);
},

_handleInputBlur(event) {
Expand Down Expand Up @@ -436,7 +436,7 @@ const TextField = React.createClass({

const inputProps = {
id: inputId,
ref: 'input',
ref: (elem) => this.input = elem,
onBlur: this._handleInputBlur,
onFocus: this._handleInputFocus,
disabled: this.props.disabled,
Expand Down

0 comments on commit eafda4b

Please sign in to comment.