Skip to content

Commit 09fce1e

Browse files
YuShengHouliweijie0812tdesign-bot
authored
fix(inputNumber): minimum value automatically modified to -Infinity (#5898)
* fix(inputNumber): minimum value automatically modified to -Infinity * chore: stash changelog [ci skip] --------- Co-authored-by: 黎伟杰 <[email protected]> Co-authored-by: tdesign-bot <[email protected]>
1 parent 1d4cf66 commit 09fce1e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/components/input-number/hooks/useInputNumber.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ export default function useInputNumber(props: TdInputNumberProps) {
208208
const handleBlur = (value: string, ctx: { e: FocusEvent }) => {
209209
const { largeNumber, max, min, decimalPlaces } = props;
210210
if (!props.allowInputOverLimit) {
211-
// 当值为 undefined 或 null 时,设置为最小值
212-
if ([undefined, null].includes(tValue.value)) {
211+
// 当值为 undefined 或 null 且最小值不为默认值 -Infinity 时,设置为最小值
212+
if ([undefined, null].includes(tValue.value) && min !== -Infinity) {
213213
setTValue(min, { type: 'blur', e: ctx.e });
214214
props.onBlur?.(min, ctx);
215215
return;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
pr_number: 5898
3+
contributor: YuShengHou
4+
---
5+
6+
- fix(inputNumber): 修复 `1.15.3` 版本后设置`allowInputOverLimit` 为 false 但未设置最小值的展示异常问题 @YuShengHou ([#5898](https://github.com/Tencent/tdesign-vue-next/pull/5898))

0 commit comments

Comments
 (0)