Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(InputNumber): Fix incorrect disable state style for input box com… #42974

Merged
merged 23 commits into from Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2bb36f1
fix(InputNumber): Fix incorrect disable state style for input box com…
kampiu Jun 12, 2023
5dbe672
fix(InputNumber): Add case previews for pre and post tags and prefix …
kampiu Jun 13, 2023
6e41329
Merge branch 'ant-design:master' into master
kampiu Jun 13, 2023
0250b42
fix(InputNumber): Fix the issue of incorrect inputNumber background c…
kampiu Jun 13, 2023
a8b4e6b
Merge branch 'ant-design:master' into master
kampiu Jun 13, 2023
2ec999f
fix(InputNumber): Remove the toggle disable state interaction in the …
kampiu Jun 13, 2023
858457a
Merge remote-tracking branch 'origin/master'
kampiu Jun 13, 2023
6571265
fix(InputNumber): Optimize and merge style processing
kampiu Jun 13, 2023
9e656cb
Merge branch 'ant-design:master' into master
kampiu Jun 14, 2023
8db58fe
fix(InputNumber): Adjust the addon case and remove irrelevant cases
kampiu Jun 14, 2023
5ae3df5
Merge branch 'ant-design:master' into master
kampiu Jun 14, 2023
396fedd
Merge branch 'ant-design:master' into master
kampiu Jun 14, 2023
23cd4f7
fix(InputNumber): Update the snapshot in the InputNumber component un…
kampiu Jun 14, 2023
fcaf920
Merge branch 'ant-design:master' into master
kampiu Jun 15, 2023
87e2b90
fix(InputNumber): Fix the issue of incorrect test snapshots caused by…
kampiu Jun 15, 2023
156bbb9
Merge branch 'ant-design:master' into master
kampiu Jun 15, 2023
4f449fa
fix(InputNumber): Fix the issue of incorrect test snapshots caused by…
kampiu Jun 15, 2023
7792cb9
fix(InputNumber): Fix the issue of incorrect test snapshots caused by…
kampiu Jun 15, 2023
3f921ed
Merge branch 'ant-design:master' into master
kampiu Jun 15, 2023
ac4e993
Merge branch 'ant-design:master' into master
kampiu Jun 15, 2023
81e170b
fix(InputNumber): Fix the issue of incorrect test snapshots caused by…
kampiu Jun 15, 2023
a73ef64
fix(InputNumber): Fix the issue of incorrect test snapshots caused by…
kampiu Jun 15, 2023
a2b5475
Merge branch 'ant-design:master' into master
kampiu Jun 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion components/input-number/index.tsx
Expand Up @@ -120,7 +120,7 @@ const InputNumber = React.forwardRef<HTMLInputElement, InputNumberProps>((props,
downHandler={downIcon}
prefixCls={prefixCls}
readOnly={readOnly}
controls={controlsTemp}
controls={!!controlsTemp}
{...others}
/>
);
Expand Down Expand Up @@ -179,6 +179,7 @@ const InputNumber = React.forwardRef<HTMLInputElement, InputNumberProps>((props,

const mergedWrapperClassName = classNames(`${prefixCls}-wrapper`, wrapperClassName, hashId, {
[`${wrapperClassName}-rtl`]: direction === 'rtl',
[`${prefixCls}-wrapper-disabled`]: mergedDisabled,
li-jia-nan marked this conversation as resolved.
Show resolved Hide resolved
});

const mergedGroupClassName = classNames(
Expand Down
28 changes: 21 additions & 7 deletions components/input-number/style/index.ts
Expand Up @@ -99,13 +99,6 @@ const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumbe
...genActiveStyle(token),
},

'&-disabled': {
...genDisabledStyle(token),
[`${componentCls}-input`]: {
cursor: 'not-allowed',
},
},

// ===================== Out Of Range =====================
'&-out-of-range': {
[`${componentCls}-input-wrap`]: {
Expand Down Expand Up @@ -140,6 +133,24 @@ const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumbe
borderRadius: borderRadiusSM,
},
},

[`${componentCls}-wrapper`]: {
'&-disabled': {
kampiu marked this conversation as resolved.
Show resolved Hide resolved
// ...genDisabledStyle(token),
[`${componentCls}-input`]: {
cursor: 'not-allowed',
kampiu marked this conversation as resolved.
Show resolved Hide resolved
},
[`& > ${componentCls}-group-addon`]: {
...genDisabledStyle(token),
},
},
},
},
},

'&-disabled': {
[`${componentCls}-input`]: {
kampiu marked this conversation as resolved.
Show resolved Hide resolved
cursor: 'not-allowed',
},
},

Expand Down Expand Up @@ -342,6 +353,9 @@ const genAffixWrapperStyles: GenerateStyle<InputNumberToken> = (token: InputNumb
[`${componentCls}[disabled]`]: {
background: 'transparent',
},
[`${componentCls}-input`]: {
cursor: 'not-allowed',
},
},

[`> div${componentCls}`]: {
Expand Down