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

Max/min mixmatch between numbers and strings #58

Open
Solaris9 opened this issue Aug 5, 2022 · 1 comment
Open

Max/min mixmatch between numbers and strings #58

Solaris9 opened this issue Aug 5, 2022 · 1 comment

Comments

@Solaris9
Copy link

Solaris9 commented Aug 5, 2022

Issue

Lets say you have a field for a username and set the min/max to 3 and 10, entering any A-Z character will work as expected but entering "11" as in the number 11 will say the input is too big for that field, it thinks you're entering a number literal instead of plain text so 11 >= 10 instead of (2 >= 11, the length of the input text). You handle both numbers and strings with the same min/max validation but there isn't an option to specific if you want a number or a string.

Solution?

Add a number type strictly for numbers only and keep the text type as stringifed text. Entering anything other than a number will remove that character and display a tooltip to let the user know only numbers are allowed.

@kamalkech
Copy link
Collaborator

@Solaris9 first of all thank u for ur investigation,
that already implemented on package for react, and currently working on solid version then we will fix for svelte too
so let s challenge the package with different cases to make it more better ;)
https://www.formly-js.com

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

No branches or pull requests

2 participants