Material-ui: TextField - minRows is not passed to TextareaAutosize

Created on 28 Sep 2020  路  4Comments  路  Source: mui-org/material-ui

  • [x] The issue is present in the latest release.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

image

https://codesandbox.io/s/elastic-microservice-g4ypj?file=/src/Demo.js

Expected Behavior 馃

Your Environment 馃寧

| Tech | Version |
| ----------- | ------- |
| Material-UI | alpha 11 |

bug 馃悰 TextField good first issue

Most helpful comment

May I work on PR with this?

All 4 comments

In our demo (text-field#multiline) we used to pass rowsMin (master) but switched to rows in next.

The TextField API now lists 3 props related to the number of rows: rows, minRows and maxRows. While fixing this bug we should probably get rid of rows as well. Too much choices in my opinion.

We forget to forward the prop:

diff --git a/packages/material-ui/src/TextField/TextField.js b/packages/material-ui/src/TextField/TextField.js
index 80470b797a..e606bf27f5 100644
--- a/packages/material-ui/src/TextField/TextField.js
+++ b/packages/material-ui/src/TextField/TextField.js
@@ -75,6 +75,7 @@ const TextField = React.forwardRef(function TextField(props, ref) {
     inputRef,
     label,
     maxRows,
+    minRows,
     multiline = false,
     name,
     onBlur,
@@ -137,6 +138,7 @@ const TextField = React.forwardRef(function TextField(props, ref) {
       name={name}
       rows={rows}
       maxRows={maxRows}
+      minRows={minRows}
       type={type}
       value={value}
       id={id}

minRows/maxRows works with TextareaAutosize only, while rows work with <textarea> only.
We used to mix the two use cases, it was creating confusion.

May I work on PR with this?

@suliskh All yours. Please let us know if you no longer intend to work on this issue. If you're stuck at any point feel free to open a PR so a maintainer can take a look.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

revskill10 picture revskill10  路  3Comments

chris-hinds picture chris-hinds  路  3Comments

activatedgeek picture activatedgeek  路  3Comments

ghost picture ghost  路  3Comments

mattmiddlesworth picture mattmiddlesworth  路  3Comments