Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input-number cannot be automatically cleared when the input value is not within the range #4534

Open
1 task
XiaoRIGE opened this issue Aug 17, 2021 · 2 comments

Comments

@XiaoRIGE
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.2.6

Environment

ant-design-vue:2.2.6 vue:3.0.0

Reproduction link

Edit on CodeSandbox

Steps to reproduce

需求是当输入值不在范围内则清空表单值

What is expected?

输入值不在范围内,清空表单,保持聚焦

What is actually happening?

输入值不在范围内,如果未失焦,视图中的值未发生改变;如果失焦,则显示正常

@tangjinzhou
Copy link
Member

临时方案

inputNumber.value.blur();
        nextTick(() => {
          valueRef.value = '';
          inputNumber.value.focus();
        });

@gangwar1
Copy link

Form validation rules are not working for min and max range validation, if the typed value exceeds the max value it returns max value in the validation rule that's it not give any error.

Is there any way to apply the min max validation rule and display an error in form validation for InputNumber?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants