fix: TextArea height bug (#33055)

* fix: TextArea height bug when has `showCount`

close #33049

* fix snapshot

* revert form demo
This commit is contained in:
afc163 2021-11-27 15:35:42 +08:00 committed by GitHub
parent 2ab4e565d6
commit 264b3514d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 8 deletions

View File

@ -7,11 +7,6 @@
// = Children Component =
// ================================================================
.@{form-item-prefix-cls} {
.@{ant-prefix}-mentions,
textarea.@{ant-prefix}-input {
height: auto;
}
// input[type=file]
.@{ant-prefix}-upload {
background: transparent;

View File

@ -3332,6 +3332,7 @@ exports[`renders ./components/input/demo/textarea-show-count.md correctly 1`] =
<div
class="ant-input-textarea ant-input-textarea-show-count"
data-count="0 / 100"
style="height:120px"
>
<textarea
class="ant-input"

View File

@ -22,5 +22,8 @@ const onChange = e => {
console.log('Change:', e.target.value);
};
ReactDOM.render(<TextArea showCount maxLength={100} onChange={onChange} />, mountNode);
ReactDOM.render(
<TextArea showCount maxLength={100} style={{ height: 120 }} onChange={onChange} />,
mountNode,
);
```

View File

@ -47,8 +47,13 @@
}
}
&-textarea {
&-show-count::after {
&-textarea-show-count {
// https://github.com/ant-design/ant-design/issues/33049
> .@{input-prefix-cls} {
height: 100%;
}
&::after {
float: right;
color: @text-color-secondary;
white-space: nowrap;