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
[b-numberinput] remove fallback to minNumber if input is not a number #2945
Labels
Comments
Validation is very important but why do you want to remove the current logic if it preserve you from invalid values? |
Probably I don't understand well but you shouldn't use non and max so the user is free to set the value as want |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Inside
Numberinput.vue
file is the next code:Here is veriffied if the input value is not valid. In case it is not valid, you assign
newValue
tominNumber
or to null. These are my points:minNumber
property. The reason si that if you want to validate the input, despite the input would be anything but a number, the validation library will accept it as a possible value because of the fallback. The next photo represents a b-numberinput whichmin
property is set to 1 and even when there is not a valid input, the validation library accepts it, because of the fallback:minNumber
should be kept, there is a problem when it is set to 0 and it is thatthis.minNumber
will return asfalse
. So the value will never fallback tominNumber
. In the next image this is reflected with a b-numberinput whichmin
property is set to 0:Why Buefy need this feature
I think this feature will improve Buefy by making it more flexible. Validation is an important part of frontend development, so I think it will be better to fallback to
minNumber
in case input is not valid. By doing this, the validation library will be able to detect the incorrect user inputThe text was updated successfully, but these errors were encountered: