You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently the documentation of min and max validators does not specify what is the behavior when a non-number value (NaN) is provided. Users may think these validators accept only numbers as valid input, but in case of a non-number the function validates its length.
Describe the solution you'd like
It would be helpful to have this explicitly stated in the documentation of min and max.
Additional context
On a side not, it might be nice to have a validator for "input is a number" (though one can get that with a pattern validator).
The text was updated successfully, but these errors were encountered:
On second thought, it could be useful to have an optional parameter that allows explicitly choosing if min should check length or numerical value. There are several cases where one would want to check for a length of a number (for example a zip code with at least 5 digits, an ID number etc.).
Indeed the documentation doesn't specifically point out that in case of a non numeric value (here: string) the validators consider the length of the value.
I am going to add that asap.
Considering your comment, in a lot of cases ZIP code have to be (most of the time) considered as string and not numbers.
Almost every countries have their zip code regex validation online and can have non numerical characters in them.
Is your feature request related to a problem? Please describe.
Currently the documentation of
min
andmax
validators does not specify what is the behavior when a non-number value (NaN
) is provided. Users may think these validators accept only numbers as valid input, but in case of a non-number the function validates its length.Describe the solution you'd like
It would be helpful to have this explicitly stated in the documentation of
min
andmax
.Additional context
On a side not, it might be nice to have a validator for "input is a number" (though one can get that with a pattern validator).
The text was updated successfully, but these errors were encountered: