Skip to content

Commit 2cf72cc

Browse files
authored
fix(inputnumber): value 大于 max 图标应处于禁用态 (#3107)
1 parent 2a74f0f commit 2cf72cc

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/packages/inputnumber/inputnumber.taro.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ export const InputNumber: FunctionComponent<
188188
className={classNames(
189189
`${classPrefix}-icon ${classPrefix}-icon-minus`,
190190
{
191-
[`${classPrefix}-icon-disabled`]: shadowValue === min || disabled,
191+
[`${classPrefix}-icon-disabled`]:
192+
Number(shadowValue) <= Number(min) || disabled,
192193
}
193194
)}
194195
/>
@@ -214,7 +215,8 @@ export const InputNumber: FunctionComponent<
214215
className={classNames(
215216
`${classPrefix}-icon ${classPrefix}-icon-plus`,
216217
{
217-
[`${classPrefix}-icon-disabled`]: shadowValue === max || disabled,
218+
[`${classPrefix}-icon-disabled`]:
219+
Number(shadowValue) >= Number(max) || disabled,
218220
}
219221
)}
220222
/>

src/packages/inputnumber/inputnumber.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ export const InputNumber: FunctionComponent<
185185
className={classNames(
186186
`${classPrefix}-icon ${classPrefix}-icon-minus`,
187187
{
188-
[`${classPrefix}-icon-disabled`]: shadowValue === min || disabled,
188+
[`${classPrefix}-icon-disabled`]:
189+
Number(shadowValue) <= Number(min) || disabled,
189190
}
190191
)}
191192
/>
@@ -208,7 +209,8 @@ export const InputNumber: FunctionComponent<
208209
className={classNames(
209210
`${classPrefix}-icon ${classPrefix}-icon-plus`,
210211
{
211-
[`${classPrefix}-icon-disabled`]: shadowValue === max || disabled,
212+
[`${classPrefix}-icon-disabled`]:
213+
Number(shadowValue) >= Number(max) || disabled,
212214
}
213215
)}
214216
/>

0 commit comments

Comments
 (0)