fix: limit input class due to rc-input won't override input class (#34294)

* fix: limit input class due to rc-input won't override input class

* fix: add feedback into affix judgement
This commit is contained in:
MadCcc 2022-03-04 12:07:25 +08:00 committed by GitHub
parent 03d8556d8c
commit 5d51e8b5b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -196,6 +196,8 @@ const Input = forwardRef<InputRef, InputProps>((props, ref) => {
</>
);
const withPrefixSuffix = hasPrefixSuffix(props) || hasFeedback;
return (
<RcInput
ref={composeRef(ref, inputRef)}
@ -207,13 +209,13 @@ const Input = forwardRef<InputRef, InputProps>((props, ref) => {
suffix={suffixNode}
clearIcon={<CloseCircleFilled />}
inputClassName={classNames(
{
!withPrefixSuffix && {
[`${prefixCls}-sm`]: mergedSize === 'small',
[`${prefixCls}-lg`]: mergedSize === 'large',
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-borderless`]: !bordered,
},
getStatusClassNames(prefixCls, mergedStatus),
!withPrefixSuffix && getStatusClassNames(prefixCls, mergedStatus),
)}
affixWrapperClassName={classNames(
{

View File

@ -129,7 +129,7 @@
"rc-dropdown": "~3.3.2",
"rc-field-form": "~1.23.0",
"rc-image": "~5.2.5",
"rc-input": "^0.0.1-alpha.3",
"rc-input": "^0.0.1-alpha.4",
"rc-input-number": "~7.3.0",
"rc-mentions": "~1.6.1",
"rc-menu": "~9.2.1",