Skip to content

Commit

Permalink
Textfield: fix focus state handling on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
xinthink committed Oct 25, 2015
1 parent 2564cd7 commit 81516f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/mdl/Textfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class Textfield extends Component {
Object.assign(this.inputFrame, {left, top, width, height});
this.refs.underline.updateLineLength(width, () => {
if (this.bufferedValue || this.isFocused()) {
this._aniStartHighlight(); // if input not empty, lift the label
this._aniStartHighlight(this.isFocused()); // if input not empty, lift the label
}
});
}
Expand All @@ -358,7 +358,7 @@ class Textfield extends Component {
}

// animation when textfield focused
_aniStartHighlight() {
_aniStartHighlight(focused) {
if (this.props.floatingLabelEnabled) {
// hide fixed placeholder, if floating
this.setPlaceholder('');
Expand All @@ -369,7 +369,7 @@ class Textfield extends Component {
}

// stretch the underline if enabled
const animations = this.refs.underline.aniStretchUnderline(this.isFocused());
const animations = this.refs.underline.aniStretchUnderline(focused);

// and lift the floating label, if enabled
if (this.props.floatingLabelEnabled) {
Expand Down Expand Up @@ -419,7 +419,7 @@ class Textfield extends Component {
}

_onFocus() {
this._aniStartHighlight();
this._aniStartHighlight(true);
this._callback('onFocus');
}

Expand Down

0 comments on commit 81516f3

Please sign in to comment.