Skip to content

Commit

Permalink
[TextField] Fix the recent regressions (mui#13017)
Browse files Browse the repository at this point in the history
* Make it so multiline, fullwidth textfield is not more than 100% width.

* handle more issues
  • Loading branch information
slipo authored and marcelpanse committed Oct 2, 2018
1 parent 2704aae commit 3c36aea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions docs/src/pages/demos/autocomplete/IntegrationDownshift.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function renderInput(inputProps) {
inputRef: ref,
classes: {
root: classes.inputRoot,
input: classes.inputInput,
},
...InputProps,
}}
Expand Down Expand Up @@ -234,6 +235,10 @@ const styles = theme => ({
inputRoot: {
flexWrap: 'wrap',
},
inputInput: {
width: 'auto',
flexGrow: 1,
},
divider: {
height: theme.spacing.unit * 2,
},
Expand Down
1 change: 1 addition & 0 deletions packages/material-ui/src/FilledInput/FilledInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const styles = theme => {
/* Styles applied to the root element if `multiline={true}`. */
multiline: {
padding: '27px 12px 10px',
boxSizing: 'border-box', // Prevent padding issue with fullWidth.
},
/* Styles applied to the `input` element. */
input: {
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/OutlinedInput/NotchedOutline.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function NotchedOutline(props) {
} = props;

const align = theme.direction === 'rtl' ? 'right' : 'left';
const labelWidth = labelWidthProp * 0.75 + 8;
const labelWidth = labelWidthProp > 0 ? labelWidthProp * 0.75 + 8 : 0;

return (
<fieldset
Expand Down
5 changes: 1 addition & 4 deletions packages/material-ui/src/OutlinedInput/OutlinedInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ export const styles = theme => {
/* Styles applied to the root element if `multiline={true}`. */
multiline: {
padding: '18.5px 14px',
// // These values are needed to prevent us from
// // overrunning the notched outline (including label)
// paddingTop: 27,
// paddingBottom: 10,
boxSizing: 'border-box', // Prevent padding issue with fullWidth.
},
/* Styles applied to the `NotchedOutline` element. */
notchedOutline: {},
Expand Down

0 comments on commit 3c36aea

Please sign in to comment.