Skip to content

Commit

Permalink
Merge pull request #980 from oliviertassinari/text-field
Browse files Browse the repository at this point in the history
[TextField] follow the spec of the floatingLabel more closely
  • Loading branch information
Hai Nguyen committed Jun 28, 2015
2 parents 377e1dd + c161749 commit 3f6bcf8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/text-field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ let TextField = React.createClass({
};

styles.floatingLabel = this.mergeStyles(styles.hint, {
top: 24,
lineHeight: '20px',
top: 38,
opacity: 1,
transform: 'scale(1) translate3d(0, 0, 0)',
transformOrigin: 'left top'
Expand All @@ -170,13 +171,13 @@ let TextField = React.createClass({

if (this.state.isFocused) {
styles.floatingLabel.color = theme.focusColor;
styles.floatingLabel.transform = 'perspective(1px) scale(0.75) translate3d(0, -18px, 0)';
styles.floatingLabel.transform = 'perspective(1px) scale(0.75) translate3d(2px, -28px, 0)';
styles.focusUnderline.transform = 'scaleX(1)';
}

if (this.state.hasValue) {
styles.floatingLabel.color = ColorManipulator.fade(props.disabled ? theme.disabledTextColor : theme.floatingLabelColor, 0.5);
styles.floatingLabel.transform = 'perspective(1px) scale(0.75) translate3d(0, -18px, 0)';
styles.floatingLabel.transform = 'perspective(1px) scale(0.75) translate3d(2px, -28px, 0)';
styles.hint.opacity = 0;
}

Expand Down

0 comments on commit 3f6bcf8

Please sign in to comment.