Repository navigation
fix(input-number): restore retained values after clearing and blurring - #6995
Merged
Merged
Conversation
dvd233
requested review from
Cat1007,
PengYYYYY,
Wesley-0808,
chaishi,
liweijie0812,
uyarn,
zhangpaopao0609 and
zydemail
as code owners
October 9, 2026 02:47
Collaborator
TDesign Component Site Preview Open
|
commit: |
uyarn
approved these changes
Oct 15, 2026
6 of 16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
Fixes #5832
💡 需求背景和解决方案
Slider 会忽略其数字输入框发出的空值,保留当前滑块数值;InputNumber 在失焦时却继续显示空白。例如滑块值为 50,清空输入框并失焦后,滑块仍为 50,输入框为空。
在 InputNumber 的空输入失焦路径中,使用当前有效值恢复显示,沿用已有的格式化与小数位数处理。受控父级保留数值时会正确回显;接受空值的
v-model和非受控 InputNumber 继续保持空白。没有更改 Slider 数值处理、公开 API、onChange/onBlur的触发顺序及参数,也不重新挂载输入框。在现有 InputNumber 和 Slider 测试文件中增加 12 条回归,覆盖零值、普通值、格式化、小数位数、大数字精度、接受空值的两种状态模式,以及范围滑块两端和相等端点。
🧪 验证
tsc --noEmit、全量 packages ESLint、改动文件 Prettier 和git diff --check通过。Windows 首次检出的 CRLF 导致全量 ESLint 报换行错误;仅将本地检出恢复为仓库已有的 LF 后通过,Git 内容差异仍只有 3 个目标文件。$12.50格式化及接受空值的 InputNumber,结果符合预期,控制台无错误或警告;最小验证页的 Vite 生产构建通过。tree/__tests__/event.test.tsx的onActive 回调可触发超过原有 300ms 时限;该文件随后以原时限在上述范围内通过。超时原因尚未确定,不将本次全量运行报告为通过。未运行完整发布包构建及全部浏览器矩阵。
📝 更新日志
tdesign-vue-next
@tdesign-vue-next/chat
无变更。
@tdesign-vue-next/nuxt
无变更。
@tdesign-vue-next/auto-import-resolver
无变更。
☑️ 请求合并前的自查清单