diff --git a/src/TextField/TextField.js b/src/TextField/TextField.js index 389d94f750314f..84b90be5141afb 100644 --- a/src/TextField/TextField.js +++ b/src/TextField/TextField.js @@ -46,6 +46,16 @@ const getStyles = (props, context, state) => { transition: transitions.easeOut(), }, floatingLabel: { + position: 'absolute', + lineHeight: '22px', + top: 38, + transition: transitions.easeOut(), + zIndex: 1, // Needed to display label above Chrome's autocomplete field background + cursor: props.disabled ? 'default' : 'text', + transform: 'scale(1) translate3d(0, 0, 0)', + transformOrigin: 'left top', + pointerEvents: 'auto', + userSelect: 'none', color: hintColor, }, input: { diff --git a/src/TextField/TextFieldLabel.js b/src/TextField/TextFieldLabel.js index 17530ea277fed8..8e561022539c5f 100644 --- a/src/TextField/TextFieldLabel.js +++ b/src/TextField/TextFieldLabel.js @@ -1,27 +1,13 @@ import React, {PropTypes} from 'react'; -import transitions from '../styles/transitions'; function getStyles(props) { - const defaultStyles = { - position: 'absolute', - lineHeight: '22px', - top: 38, - transition: transitions.easeOut(), - zIndex: 1, // Needed to display label above Chrome's autocomplete field background - cursor: props.disabled ? 'default' : 'text', - transform: 'scale(1) translate3d(0, 0, 0)', - transformOrigin: 'left top', - pointerEvents: 'auto', - userSelect: 'none', - }; - const shrinkStyles = props.shrink ? Object.assign({ transform: 'perspective(1px) scale(0.75) translate3d(0, -28px, 0)', pointerEvents: 'none', }, props.shrinkStyle) : null; return { - root: Object.assign(defaultStyles, props.style, shrinkStyles), + root: Object.assign(props.style, shrinkStyles), }; }