mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 11:32:52 +08:00
refactor: adjust TextArea in form (#34714)
This commit is contained in:
parent
7c4e12f99e
commit
0d4cc5ed33
@ -5188,7 +5188,7 @@ exports[`renders ./components/form/demo/register.md extend context correctly 1`]
|
||||
class="ant-form-item-control-input-content"
|
||||
>
|
||||
<div
|
||||
class="ant-input-textarea ant-input-textarea-show-count"
|
||||
class="ant-input-textarea ant-input-textarea-show-count ant-input-textarea-in-form-item"
|
||||
data-count="0 / 100"
|
||||
>
|
||||
<textarea
|
||||
@ -22272,7 +22272,7 @@ exports[`renders ./components/form/demo/validate-static.md extend context correc
|
||||
class="ant-form-item-control-input-content"
|
||||
>
|
||||
<div
|
||||
class="ant-input-textarea ant-input-textarea-show-count ant-input-textarea-status-error ant-input-textarea-has-feedback"
|
||||
class="ant-input-textarea ant-input-textarea-show-count ant-input-textarea-in-form-item ant-input-textarea-status-error ant-input-textarea-has-feedback"
|
||||
data-count="0"
|
||||
>
|
||||
<span
|
||||
|
@ -4370,7 +4370,7 @@ exports[`renders ./components/form/demo/register.md correctly 1`] = `
|
||||
class="ant-form-item-control-input-content"
|
||||
>
|
||||
<div
|
||||
class="ant-input-textarea ant-input-textarea-show-count"
|
||||
class="ant-input-textarea ant-input-textarea-show-count ant-input-textarea-in-form-item"
|
||||
data-count="0 / 100"
|
||||
>
|
||||
<textarea
|
||||
@ -9002,7 +9002,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
|
||||
class="ant-form-item-control-input-content"
|
||||
>
|
||||
<div
|
||||
class="ant-input-textarea ant-input-textarea-show-count ant-input-textarea-status-error ant-input-textarea-has-feedback"
|
||||
class="ant-input-textarea ant-input-textarea-show-count ant-input-textarea-in-form-item ant-input-textarea-status-error ant-input-textarea-has-feedback"
|
||||
data-count="0"
|
||||
>
|
||||
<span
|
||||
|
@ -212,12 +212,6 @@
|
||||
min-height: @form-item-margin-bottom;
|
||||
}
|
||||
|
||||
.@{ant-prefix}-input-textarea-show-count {
|
||||
&::after {
|
||||
margin-bottom: -22px;
|
||||
}
|
||||
}
|
||||
|
||||
&-with-help &-explain {
|
||||
height: auto;
|
||||
min-height: @form-item-margin-bottom;
|
||||
|
@ -77,6 +77,7 @@ const TextArea = React.forwardRef<TextAreaRef, TextAreaProps>(
|
||||
const {
|
||||
status: contextStatus,
|
||||
hasFeedback,
|
||||
isFormItemInput,
|
||||
feedbackIcon,
|
||||
} = React.useContext(FormItemInputContext);
|
||||
const mergedStatus = getMergedStatus(contextStatus, customStatus);
|
||||
@ -233,6 +234,7 @@ const TextArea = React.forwardRef<TextAreaRef, TextAreaProps>(
|
||||
{
|
||||
[`${prefixCls}-textarea-rtl`]: direction === 'rtl',
|
||||
[`${prefixCls}-textarea-show-count`]: showCount,
|
||||
[`${prefixCls}-textarea-in-form-item`]: isFormItemInput,
|
||||
},
|
||||
getStatusClassNames(`${prefixCls}-textarea`, mergedStatus, hasFeedback),
|
||||
className,
|
||||
|
@ -61,6 +61,12 @@
|
||||
content: attr(data-count);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&.@{input-prefix-cls}-textarea-in-form-item {
|
||||
&::after {
|
||||
margin-bottom: -22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-textarea-suffix {
|
||||
|
Loading…
Reference in New Issue
Block a user