Repository: ant-design/ant-design-mobile (ts)

Issue:
TextArea rows 存在默认值 2，导致  autoSize >  minRows 传入 1 无效，组件高度应为 rows为1，但实际上是rows为2的高度
### Version of antd-mobile

5.29.1

### Operating system and its version

iOS, Android

### Browser and its version

ios chrome 110.0

### Sandbox to reproduce

_No response_

### What happened?

[官网示例](https://mobile.ant.design/zh/components/text-area) 的codeSandBox即可复现.

```
 <TextArea
    placeholder='请输入内容'
    value={value}
    onChange={val => {
      setValue(val)
    }}
    autoSize={{ minRows: 1 }}
  />
```
![image](https://github.com/ant-design/ant-design-mobile/assets/31724313/7d86d507-10e1-4eb8-827b-8310c5896c5f)
![image](https://github.com/ant-design/ant-design-mobile/assets/31724313/26a9b552-ad7c-4ede-bdde-7b110d46c5c6)
![image](https://github.com/ant-design/ant-design-mobile/assets/31724313/966ad6a0-69a6-4ec5-b846-b8e1e81a8cc3)


### Relevant log output

_No response_

Pull request:
fix(TextArea): reset rows when rows exceed autoSize
fix #6249

Patch:
diff --git a/src/components/steps/steps.tsx b/src/components/steps/steps.tsx
index 8f85fe243..224c3de33 100644
--- a/src/components/steps/steps.tsx
+++ b/src/components/steps/steps.tsx
@@ -1,6 +1,6 @@
 import React, { FC } from 'react'
 import classNames from 'classnames'
-import { StepProps } from './step'
+import type { StepProps } from './step'
 import { mergeProps } from '../../utils/with-default-props'
 import { NativeProps, withNativeProps } from '../../utils/native-props'
 
@@ -53,7 +53,7 @@ export const Steps: FC<StepsProps> = p => {
         return React.cloneElement(child, {
           status,
           icon,
-        })
+        } as StepProps)
       })}
     </div>
   )
diff --git a/src/components/text-area/text-area.tsx b/src/components/text-area/text-area.tsx
index dcc3e47df..b799f4001 100644
--- a/src/components/text-area/text-area.tsx
+++ b/src/components/text-area/text-area.tsx
@@ -135,13 +135,23 @@ export const TextArea = forwardRef<TextAreaRef, TextAreaProps>(
       )
     }
 
+    let rows = props.rows
+    if (typeof autoSize === 'object') {
+      if (autoSize.maxRows && rows > autoSize.maxRows) {
+        rows = autoSize.maxRows
+      }
+      if (autoSize.minRows && rows < autoSize.minRows) {
+        rows = autoSize.minRows
+      }
+    }
+
     return withNativeProps(
       props,
       <div className={classPrefix}>
         <textarea
           ref={nativeTextAreaRef}
           className={`${classPrefix}-element`}
-          rows={props.rows}
+          rows={rows}
           value={value}
           placeholder={props.placeholder}
           onChange={e => {
@@ -180,7 +190,7 @@ export const TextArea = forwardRef<TextAreaRef, TextAreaProps>(
             ref={hiddenTextAreaRef}
             className={`${classPrefix}-element ${classPrefix}-element-hidden`}
             value={value}
-            rows={props.rows}
+            rows={rows}
             aria-hidden
             readOnly
           />


Test patch:
diff --git a/src/components/text-area/tests/text-area.test.tsx b/src/components/text-area/tests/text-area.test.tsx
index 6f3d4dfc8..d5aba7ff6 100644
--- a/src/components/text-area/tests/text-area.test.tsx
+++ b/src/components/text-area/tests/text-area.test.tsx
@@ -130,4 +130,16 @@ describe('TextArea', () => {
     expect(textarea).toHaveAttribute('rows', '1')
     expect(hiddenTextarea).toHaveAttribute('rows', '1')
   })
+
+  test('rows should be the minRows when rows < minRows', () => {
+    const { getByRole } = render(<TextArea autoSize={{ minRows: 3 }} />)
+    const textarea = getByRole('textbox')
+    expect(textarea).toHaveAttribute('rows', '3')
+  })
+
+  test('rows should be the maxRows when rows > maxRows', () => {
+    const { getByRole } = render(<TextArea autoSize={{ maxRows: 1 }} />)
+    const textarea = getByRole('textbox')
+    expect(textarea).toHaveAttribute('rows', '1')
+  })
 })