fix: diabled Input abbdon should not have status style (#40744)

Co-authored-by: zhouling <zhouling@kezaihui.com>
This commit is contained in:
carla-cn 2023-02-17 15:45:29 +08:00 committed by GitHub
parent 40abef340a
commit fd2db7614f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 10 deletions

View File

@ -16015,7 +16015,7 @@ exports[`ConfigProvider components Input configProvider componentDisabled 1`] =
value=""
/>
<span
class="config-input-group-wrapper config-input-search"
class="config-input-group-wrapper config-input-search config-input-group-wrapper-disabled"
>
<span
class="config-input-wrapper config-input-group"

View File

@ -5526,7 +5526,7 @@ exports[`renders ./components/form/demo/disabled-input-debug.tsx extend context
class="ant-form-item-control-input-content"
>
<span
class="ant-input-group-wrapper ant-input-group-wrapper-status-error"
class="ant-input-group-wrapper ant-input-group-wrapper-disabled ant-input-group-wrapper-status-error"
>
<span
class="ant-input-wrapper ant-input-group"

View File

@ -2999,7 +2999,7 @@ exports[`renders ./components/form/demo/disabled-input-debug.tsx correctly 1`] =
class="ant-form-item-control-input-content"
>
<span
class="ant-input-group-wrapper ant-input-group-wrapper-status-error"
class="ant-input-group-wrapper ant-input-group-wrapper-disabled ant-input-group-wrapper-status-error"
>
<span
class="ant-input-wrapper ant-input-group"

View File

@ -219,6 +219,7 @@ const Input = forwardRef<InputRef, InputProps>((props, ref) => {
[`${prefixCls}-group-wrapper-sm`]: mergedSize === 'small',
[`${prefixCls}-group-wrapper-lg`]: mergedSize === 'large',
[`${prefixCls}-group-wrapper-rtl`]: direction === 'rtl',
[`${prefixCls}-group-wrapper-disabled`]: mergedDisabled,
},
getStatusClassNames(`${prefixCls}-group-wrapper`, mergedStatus, hasFeedback),
hashId,

View File

@ -1,9 +1,9 @@
import type { CSSObject } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle } from '../../theme/internal';
import { genComponentStyleHook, mergeToken } from '../../theme/internal';
import type { GlobalToken } from '../../theme/interface';
import { clearFix, resetComponent } from '../../style';
import { genCompactItemStyle } from '../../style/compact-item';
import type { GlobalToken } from '../../theme/interface';
import type { FullToken, GenerateStyle } from '../../theme/internal';
import { genComponentStyleHook, mergeToken } from '../../theme/internal';
export type InputToken<T extends GlobalToken = FullToken<'Input'>> = T & {
inputAffixPadding: number;
@ -669,7 +669,7 @@ const genAffixStyle: GenerateStyle<InputToken> = (token: InputToken) => {
};
const genGroupStyle: GenerateStyle<InputToken> = (token: InputToken) => {
const { componentCls, colorError, colorSuccess, borderRadiusLG, borderRadiusSM } = token;
const { componentCls, colorError, colorWarning, borderRadiusLG, borderRadiusSM } = token;
return {
[`${componentCls}-group`]: {
@ -711,9 +711,15 @@ const genGroupStyle: GenerateStyle<InputToken> = (token: InputToken) => {
},
},
'&-status-warning': {
[`${componentCls}-group-addon:last-child`]: {
color: colorSuccess,
borderColor: colorSuccess,
[`${componentCls}-group-addon`]: {
color: colorWarning,
borderColor: colorWarning,
},
},
'&-disabled': {
[`${componentCls}-group-addon`]: {
...genDisabledStyle(token),
},
},
},