Open francosalcedo opened 6 years ago
Thank you for bug report.
As I see per code, minLength and maxLength validators do not check if input is empty.
I will update code in coming days. For now you can manually remove also min/max attributes.
@Mevrael
Thank you for your prompt response, I will be attentive.
Hi @francosalcedo
I am very sorry for delay and I do believe you solved you problem by adjusting code manually, however, I would appreciate if you could do a simple PR and just add input.value.length > 0
to min/max length validators.
https://github.com/Mevrael/bunny/blob/master/src/Validation.js#L157
You can scroll this line up and check "tel" validator to see an example.
I will get my IDE and anything else on my machine this weekend and would be able just to merge, build and release new NPM version.
Thanks
Reproduce problem: https://jsfiddle.net/oc0veLLp/9/
Hi, I have the following problem, if I want a field to don't required (Once the form has been initialized, and this changed dynamically), I delete the "required" by javascript but if the field has other attributes such as "minLength" or "maxLength" it is still mandatory.
How can I solve this in the best way?
thanks