Skip to content

[TextField] Pass rowsMin prop to underlying abstractions #15411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/material-ui/src/FilledInput/FilledInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
4 changes: 4 additions & 0 deletions packages/material-ui/src/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
1 change: 1 addition & 0 deletions packages/material-ui/src/InputBase/InputBase.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions packages/material-ui/src/InputBase/Textarea.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface TextareaProps
disabled?: boolean;
rows?: string | number;
rowsMax?: string | number;
rowsMin?: string | number;
textareaRef?: React.Ref<any> | React.RefObject<any>;
value?: unknown;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/material-ui/src/OutlinedInput/OutlinedInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
1 change: 1 addition & 0 deletions packages/material-ui/src/TextField/TextField.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface BaseTextFieldProps
required?: boolean;
rows?: string | number;
rowsMax?: string | number;
rowsMin?: string | number;
select?: boolean;
SelectProps?: Partial<SelectProps>;
type?: string;
Expand Down
6 changes: 6 additions & 0 deletions packages/material-ui/src/TextField/TextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const TextField = React.forwardRef(function TextField(props, ref) {
required,
rows,
rowsMax,
rowsMin,
select,
SelectProps,
type,
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions pages/api/filled-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import FilledInput from '@material-ui/core/FilledInput';
| <span class="prop-name">required</span> | <span class="prop-type">bool</span> | | If `true`, the `input` element will be required. |
| <span class="prop-name">rows</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Number of rows to display when multiline option is set to true. |
| <span class="prop-name">rowsMax</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Maximum number of rows to display when multiline option is set to true. |
| <span class="prop-name">rowsMin</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Minimum number of rows to display when multiline option is set to true. |
| <span class="prop-name">startAdornment</span> | <span class="prop-type">node</span> | | Start `InputAdornment` for this component. |
| <span class="prop-name">type</span> | <span class="prop-type">string</span> | | 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). |
| <span class="prop-name">value</span> | <span class="prop-type">any</span> | | The value of the `input` element, required for a controlled component. |
Expand Down
1 change: 1 addition & 0 deletions pages/api/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import Input from '@material-ui/core/Input';
| <span class="prop-name">required</span> | <span class="prop-type">bool</span> | | If `true`, the `input` element will be required. |
| <span class="prop-name">rows</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Number of rows to display when multiline option is set to true. |
| <span class="prop-name">rowsMax</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Maximum number of rows to display when multiline option is set to true. |
| <span class="prop-name">rowsMin</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Minimum number of rows to display when multiline option is set to true. |
| <span class="prop-name">startAdornment</span> | <span class="prop-type">node</span> | | Start `InputAdornment` for this component. |
| <span class="prop-name">type</span> | <span class="prop-type">string</span> | | 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). |
| <span class="prop-name">value</span> | <span class="prop-type">any</span> | | The value of the `input` element, required for a controlled component. |
Expand Down
1 change: 1 addition & 0 deletions pages/api/outlined-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import OutlinedInput from '@material-ui/core/OutlinedInput';
| <span class="prop-name">required</span> | <span class="prop-type">bool</span> | | If `true`, the `input` element will be required. |
| <span class="prop-name">rows</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Number of rows to display when multiline option is set to true. |
| <span class="prop-name">rowsMax</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Maximum number of rows to display when multiline option is set to true. |
| <span class="prop-name">rowsMin</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Minimum number of rows to display when multiline option is set to true. |
| <span class="prop-name">startAdornment</span> | <span class="prop-type">node</span> | | Start `InputAdornment` for this component. |
| <span class="prop-name">type</span> | <span class="prop-type">string</span> | | 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). |
| <span class="prop-name">value</span> | <span class="prop-type">any</span> | | The value of the `input` element, required for a controlled component. |
Expand Down
1 change: 1 addition & 0 deletions pages/api/text-field.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ For advanced cases, please look at the source of TextField by clicking on the
| <span class="prop-name">required</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the label is displayed as required and the `input` element` will be required. |
| <span class="prop-name">rows</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Number of rows to display when multiline option is set to true. |
| <span class="prop-name">rowsMax</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Maximum number of rows to display when multiline option is set to true. |
| <span class="prop-name">rowsMin</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;number<br></span> | | Minimum number of rows to display when multiline option is set to true. |
| <span class="prop-name">select</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | 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. |
| <span class="prop-name">SelectProps</span> | <span class="prop-type">object</span> | | Properties applied to the [`Select`](/api/select/) element. |
| <span class="prop-name">type</span> | <span class="prop-type">string</span> | | 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). |
Expand Down