fix: Modify format conditions#442
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #442 +/- ##
=======================================
Coverage 97.82% 97.82%
=======================================
Files 9 9
Lines 460 460
Branches 121 121
=======================================
Hits 450 450
Misses 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
来个测试用例?这个直接删了逻辑总感觉有点怪 |
目前项目中的用例都是通过的。 并没有发现需要依赖!userTypingRef.current触发setInputValue的情况。 |
| // When user typing from `1.2` to `1.`, we should not convert to `1` immediately. | ||
| // But let it go if user set `formatter` | ||
| if (!newValue.equals(currentParsedValue) || !userTypingRef.current || formatter) { | ||
| if (!newValue.equals(currentParsedValue) || formatter) { |
There was a problem hiding this comment.
看看能不能找到当初加 !userTypingRef.current 的用意
There was a problem hiding this comment.
兼容古早的 string number 转换的,过去 onChange 事件如果不是有效值就会给 string value,是有效值就会给 number value。后来剥掉的,但是为了兼容就留了这个。
|
此问题项目中遇到了,请问这个修复什么时候合并发布? |
|
在项目中遇到这个问题,请问该修复何时发布?或者是否有其他兼容方式解决这个问题?😄 @Song-aff |
|
目前在项目中遇到这个问题,想问一下该修复要发布了吗? |
[English Template / 英文模板]
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
antd中 ant-design/ant-design#36074 经过定位,问题在rc-input-number组件中。
可与 https://codesandbox.io/s/lucid-varahamihira-yfwuub?file=/src/App.js 中复现(safari浏览器、中文输入法下)。
其产生原因为 safari 浏览器在中文输入法时,会改变keydown事件触发时间,对format条件进行修改可以解决该问题。
📝 更新日志
☑️ 请求合并前的自查清单