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

🐛 [Bug]: [numeric] The step-strictly function of the Numeric component is incorrect #964

Closed
AcWrong02 opened this issue Nov 30, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@AcWrong02
Copy link
Collaborator

Version

latest

Vue Version

latest

Link to minimal reproduction

https://opentiny.design/vue-playground?mode=pc&theme=default#3.11|eyJzcmMvQXBwLnZ1ZSI6IjxzY3JpcHQgbGFuZz1cInRzeFwiPlxuLy8g5byV5YWlIEBvcGVudGlueS92dWUg57uE5Lu2XG5pbXBvcnQgeyBCdXR0b24sIExpbmsgfSBmcm9tICdAb3BlbnRpbnkvdnVlJ1xuXG5leHBvcnQgZGVmYXVsdCB7XG4gIGNvbXBvbmVudHM6IHtcbiAgICBUaW55QnV0dG9uOiBCdXR0b24sXG4gICAgVGlueUxpbms6IExpbmtcbiAgfSxcbiAgZGF0YSgpIHtcbiAgICByZXR1cm4ge1xuICAgICAgbXNnOiAnaGVsbG8gd29ybGQhJ1xuICAgIH1cbiAgfVxufVxuPC9zY3JpcHQ+XG5cbjx0ZW1wbGF0ZT5cbiAgPFRpbnlCdXR0b24+56Gu5a6aPC9UaW55QnV0dG9uPlxuICA8aDE+e3sgbXNnIH19PC9oMT5cbiAgPGRpdiBjbGFzcz1cInRpbnl2dWVcIj5cbiAgICA8ZGl2IGNsYXNzPVwidGlueXZ1ZS1wYWdlXCI+XG4gICAgICB0aW55dnVlXG4gICAgICA8dGlueS1saW5rIHR5cGU9XCJzdWNjZXNzXCIgaHJlZj0naHR0cHM6Ly9naXRodWIuY29tL29wZW50aW55L3RpbnktdnVlJz5cbiAgICAgICAgdGlueXZ1ZVxuICAgICAgPC90aW55LWxpbms+XG4gICAgPC9kaXY+XG4gIDwvZGl2PlxuPC90ZW1wbGF0ZT5cblxuPHN0eWxlIGxhb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CdW5kbGVyXCIsXHJcbiAgICBcImFsbG93SW1wb3J0aW5nVHNFeHRlbnNpb25zXCI6IHRydWVcclxuICB9LFxyXG4gIFwidnVlQ29tcGlsZXJPcHRpb25zXCI6IHtcclxuICAgIFwidGFyZ2V0XCI6IDMuM1xyXG4gIH1cclxufVxyXG4iLCJhbGxvdy1lbXB0eS52dWUiOiI8dGVtcGxhdGU+XG4gIDx0aW55LW51bWVyaWNcbiAgICB2LW1vZGVsPVwic3RlcE51bVwiXG4gICAgOnN0ZXA9XCJzdGVwXCJcbiAgICBzdGVwLXN0cmljdGx5XG4gID48L3RpbnktbnVtZXJpYz5cbjwvdGVtcGxhdGU+XG5cbjxzY3JpcHQgc2V0dXAgbGFuZz1cImpzeFwiPlxuaW1wb3J0IHsgcmVmIH0gZnJvbSAndnVlJ1xuaW1wb3J0IHsgTnVtZXJpYyBhcyBUaW55TnVtZXJpYywgTW9kYWwgfSBmcm9tICdAb3BlbnRpbnkvdnVlJ1xuXG5jb25zdCBzdGVwID0gcmVmKDIpXG5jb25zdCBzdGVwTnVtID0gcmVmKDIpXG48L3NjcmlwdD5cbiIsIl9vIjp7fX0=

Step to reproduce

打开playground

What is expected

在step-strictly模式下,且step等于2的时候,输入框应该只能输入为2的倍数的数,或者是自动化格式到为2的倍数

What is actually happening

在step-strictly模式下,且step等于2的时候,我可以输入任何值的数

Any additional comments (optional)

No response

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛 [Bug]: The step-strictly function of Numeric component is wrong

@Huangyilin19
Copy link
Collaborator

问题已收到,我们尽快出方案解决.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


The problem has been received and we will provide a solution as soon as possible.

@kagol kagol changed the title 🐛 [Bug]: Numeric组件的step-strictly功能不对 🐛 [Bug]: [numeric] The step-strictly function of the Numeric component is incorrect Dec 9, 2023
@James-9696
Copy link
Collaborator

此问题 已通过#1284解决,当设置step为5时,用户输入的值为6,那么输入框将会自动取值为5。当用户输入的值为9,那么输入框将会自动取值为10。后续发布的3.20版本,也可以这么设置:step={ value: 5, mode: 'strictly' } 等同于 step-strictly

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


This problem has been solved through #1284. When setting step to 5 and the user inputs a value of 6, the input box will automatically take a value of 5. When the user enters a value of 9, the input box will automatically take a value of 10. The subsequent version 3.20 can also be set like this: step={ value: 5, mode: 'strictly' } which is equivalent to step-strictly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants