From 335adafac29b976cb3876f475449e698a89630a5 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Wed, 6 Jul 2016 20:26:20 +0200 Subject: [PATCH] [TextField] Fix multi-line overflow Continuation of #4620 Closes #4620 Closes #4276 Closes #4331 --- src/TextField/EnhancedTextarea.js | 4 ++-- src/TextField/TextField.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/TextField/EnhancedTextarea.js b/src/TextField/EnhancedTextarea.js index 9ba4ee274cdbd3..e3a5bbafcabba9 100644 --- a/src/TextField/EnhancedTextarea.js +++ b/src/TextField/EnhancedTextarea.js @@ -135,8 +135,8 @@ class EnhancedTextarea extends Component { const {prepareStyles} = this.context.muiTheme; const styles = getStyles(this.props, this.context, this.state); - const rootStyles = Object.assign({}, styles.root, style); - const textareaStyles = Object.assign({}, styles.textarea, textareaStyle); + const rootStyles = Object.assign(styles.root, style); + const textareaStyles = Object.assign(styles.textarea, textareaStyle); const shadowStyles = Object.assign({}, textareaStyles, styles.shadow, shadowStyle); if (this.props.hasOwnProperty('valueLink')) { diff --git a/src/TextField/TextField.js b/src/TextField/TextField.js index 3b77a6a78cbfe6..3c144a17f91649 100644 --- a/src/TextField/TextField.js +++ b/src/TextField/TextField.js @@ -54,7 +54,6 @@ const getStyles = (props, context, state) => { padding: 0, position: 'relative', width: '100%', - height: '100%', border: 'none', outline: 'none', backgroundColor: 'rgba(0,0,0,0)', @@ -62,7 +61,8 @@ const getStyles = (props, context, state) => { cursor: props.disabled ? 'not-allowed' : 'initial', font: 'inherit', }, - textarea: {}, + textarea: { + }, }; Object.assign(styles.error, props.errorStyle); @@ -74,6 +74,9 @@ const getStyles = (props, context, state) => { font: 'inherit', }); + // Do not assign a height to the textarea as he handles it on his own. + styles.input.height = '100%'; + if (state.hasValue) { styles.floatingLabel.color = fade(props.disabled ? disabledTextColor : floatingLabelColor, 0.5); }