Open
Conversation
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.
修复InputNumber组件数据更新问题,问题来自#326
问题出现原因为InputNumber组件会在每次内容发生变化时实时更新值,并判断最大最小值等一系列情况,因此当用户想重新输入数据后,在输入第一位数字时值只能在0-9之间,如果最小值至少为10就会直接更新为最小值,从而导致后续的输入问题
结合过往网页使用体验并参考了其他组件库,发现绝大部分数字输入框的值更新会发生在其失焦时,这样可以使用户自由地输入所需内容,并在最后确定是否符合限定条件,不会在输入的过程中不断处理,保证了用户流畅的使用过程,同时避免了过高频率的检测限制了直接输入的内容,导致很多值只能通过逐渐加减来得到
本问题解决方法为将组件内检测值是否合法的过程由input以及change时会触发的change函数中移动至失焦时触发的blur函数中,即可得到常规的使用效果