diff --git a/packages/material-ui/src/FilledInput/FilledInput.js b/packages/material-ui/src/FilledInput/FilledInput.js index cf419f268e64ff..e71a58e0060a5a 100644 --- a/packages/material-ui/src/FilledInput/FilledInput.js +++ b/packages/material-ui/src/FilledInput/FilledInput.js @@ -243,6 +243,10 @@ FilledInput.propTypes = { * Maximum number of rows to display when multiline option is set to true. */ rowsMax: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + /** + * Minimum number of rows to display when multiline option is set to true. + */ + rowsMin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), /** * Start `InputAdornment` for this component. */ diff --git a/packages/material-ui/src/Input/Input.js b/packages/material-ui/src/Input/Input.js index 8dfb6dfcfff531..5cae9525b2540d 100644 --- a/packages/material-ui/src/Input/Input.js +++ b/packages/material-ui/src/Input/Input.js @@ -211,6 +211,10 @@ Input.propTypes = { * Maximum number of rows to display when multiline option is set to true. */ rowsMax: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + /** + * Minimum number of rows to display when multiline option is set to true. + */ + rowsMin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), /** * Start `InputAdornment` for this component. */ diff --git a/packages/material-ui/src/InputBase/InputBase.d.ts b/packages/material-ui/src/InputBase/InputBase.d.ts index a65b7ed87461dc..371513291cc98b 100644 --- a/packages/material-ui/src/InputBase/InputBase.d.ts +++ b/packages/material-ui/src/InputBase/InputBase.d.ts @@ -35,6 +35,7 @@ export interface InputBaseProps }) => React.ReactNode; rows?: string | number; rowsMax?: string | number; + rowsMin?: string | number; startAdornment?: React.ReactNode; type?: string; value?: unknown; diff --git a/packages/material-ui/src/InputBase/Textarea.d.ts b/packages/material-ui/src/InputBase/Textarea.d.ts index efc000e844f0ad..f63a9fbd7c471a 100644 --- a/packages/material-ui/src/InputBase/Textarea.d.ts +++ b/packages/material-ui/src/InputBase/Textarea.d.ts @@ -11,6 +11,7 @@ export interface TextareaProps disabled?: boolean; rows?: string | number; rowsMax?: string | number; + rowsMin?: string | number; textareaRef?: React.Ref | React.RefObject; value?: unknown; } diff --git a/packages/material-ui/src/OutlinedInput/OutlinedInput.js b/packages/material-ui/src/OutlinedInput/OutlinedInput.js index 3b1cc9a8be6773..0c77e6928349ac 100644 --- a/packages/material-ui/src/OutlinedInput/OutlinedInput.js +++ b/packages/material-ui/src/OutlinedInput/OutlinedInput.js @@ -214,6 +214,10 @@ OutlinedInput.propTypes = { * Maximum number of rows to display when multiline option is set to true. */ rowsMax: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + /** + * Minimum number of rows to display when multiline option is set to true. + */ + rowsMin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), /** * Start `InputAdornment` for this component. */ diff --git a/packages/material-ui/src/TextField/TextField.d.ts b/packages/material-ui/src/TextField/TextField.d.ts index 31282f7746d916..e3d27d992ca670 100644 --- a/packages/material-ui/src/TextField/TextField.d.ts +++ b/packages/material-ui/src/TextField/TextField.d.ts @@ -31,6 +31,7 @@ export interface BaseTextFieldProps required?: boolean; rows?: string | number; rowsMax?: string | number; + rowsMin?: string | number; select?: boolean; SelectProps?: Partial; type?: string; diff --git a/packages/material-ui/src/TextField/TextField.js b/packages/material-ui/src/TextField/TextField.js index dad3bf7735e70a..9e00892ad8aec4 100644 --- a/packages/material-ui/src/TextField/TextField.js +++ b/packages/material-ui/src/TextField/TextField.js @@ -84,6 +84,7 @@ const TextField = React.forwardRef(function TextField(props, ref) { required, rows, rowsMax, + rowsMin, select, SelectProps, type, @@ -130,6 +131,7 @@ const TextField = React.forwardRef(function TextField(props, ref) { name={name} rows={rows} rowsMax={rowsMax} + rowsMin={rowsMin} type={type} value={value} id={id} @@ -294,6 +296,10 @@ TextField.propTypes = { * Maximum number of rows to display when multiline option is set to true. */ rowsMax: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + /** + * Minimum number of rows to display when multiline option is set to true. + */ + rowsMin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), /** * Render a [`Select`](/api/select/) element while passing the Input element to `Select` as `input` parameter. * If this option is set you must pass the options of the select as children. diff --git a/pages/api/filled-input.md b/pages/api/filled-input.md index fcbdbf5fe1f1ef..b40999bb6b6b74 100644 --- a/pages/api/filled-input.md +++ b/pages/api/filled-input.md @@ -41,6 +41,7 @@ import FilledInput from '@material-ui/core/FilledInput'; | required | bool | | If `true`, the `input` element will be required. | | rows | union: string |
 number
| | Number of rows to display when multiline option is set to true. | | rowsMax | union: string |
 number
| | Maximum number of rows to display when multiline option is set to true. | +| rowsMin | union: string |
 number
| | Minimum number of rows to display when multiline option is set to true. | | startAdornment | node | | Start `InputAdornment` for this component. | | type | string | | Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types). | | value | any | | The value of the `input` element, required for a controlled component. | diff --git a/pages/api/input.md b/pages/api/input.md index a7fc384fdcb53f..b1337eee462bb8 100644 --- a/pages/api/input.md +++ b/pages/api/input.md @@ -41,6 +41,7 @@ import Input from '@material-ui/core/Input'; | required | bool | | If `true`, the `input` element will be required. | | rows | union: string |
 number
| | Number of rows to display when multiline option is set to true. | | rowsMax | union: string |
 number
| | Maximum number of rows to display when multiline option is set to true. | +| rowsMin | union: string |
 number
| | Minimum number of rows to display when multiline option is set to true. | | startAdornment | node | | Start `InputAdornment` for this component. | | type | string | | Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types). | | value | any | | The value of the `input` element, required for a controlled component. | diff --git a/pages/api/outlined-input.md b/pages/api/outlined-input.md index bb12288763827b..aca6da717ba343 100644 --- a/pages/api/outlined-input.md +++ b/pages/api/outlined-input.md @@ -42,6 +42,7 @@ import OutlinedInput from '@material-ui/core/OutlinedInput'; | required | bool | | If `true`, the `input` element will be required. | | rows | union: string |
 number
| | Number of rows to display when multiline option is set to true. | | rowsMax | union: string |
 number
| | Maximum number of rows to display when multiline option is set to true. | +| rowsMin | union: string |
 number
| | Minimum number of rows to display when multiline option is set to true. | | startAdornment | node | | Start `InputAdornment` for this component. | | type | string | | Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types). | | value | any | | The value of the `input` element, required for a controlled component. | diff --git a/pages/api/text-field.md b/pages/api/text-field.md index 8fdb03d004cd81..b09b11999800d7 100644 --- a/pages/api/text-field.md +++ b/pages/api/text-field.md @@ -70,6 +70,7 @@ For advanced cases, please look at the source of TextField by clicking on the | required | bool | false | If `true`, the label is displayed as required and the `input` element` will be required. | | rows | union: string |
 number
| | Number of rows to display when multiline option is set to true. | | rowsMax | union: string |
 number
| | Maximum number of rows to display when multiline option is set to true. | +| rowsMin | union: string |
 number
| | Minimum number of rows to display when multiline option is set to true. | | select | bool | false | Render a [`Select`](/api/select/) element while passing the Input element to `Select` as `input` parameter. If this option is set you must pass the options of the select as children. | | SelectProps | object | | Properties applied to the [`Select`](/api/select/) element. | | type | string | | Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types). |