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 = // = Children Component =
// ================================================================ // ================================================================
.@{form-item-prefix-cls} { .@{form-item-prefix-cls} {
.@{ant-prefix}-mentions,
textarea.@{ant-prefix}-input {
height: auto;
}
// input[type=file] // input[type=file]
.@{ant-prefix}-upload { .@{ant-prefix}-upload {
background: transparent; background: transparent;

View File

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

View File

@ -22,5 +22,8 @@ const onChange = e => {
console.log('Change:', e.target.value); 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 { &-textarea-show-count {
&-show-count::after { // https://github.com/ant-design/ant-design/issues/33049
> .@{input-prefix-cls} {
height: 100%;
}
&::after {
float: right; float: right;
color: @text-color-secondary; color: @text-color-secondary;
white-space: nowrap; white-space: nowrap;