vitmalina / w2ui

UI widgets for modern apps. Data table, forms, toolbars, sidebar, tabs, tooltips, popups. All under 120kb (gzipped).
http://w2ui.com
MIT License
2.64k stars 730 forks source link

Non-required numeric field validation with min option-property #2460

Closed zbeebembg closed 8 months ago

zbeebembg commented 10 months ago

Short description Non-required numeric fields will show a value error if they have a "min" option-property and are left as null.

What is current behavior I have noticed that when validating numeric fields, the min option-property will "override" the required property. For example I have a field of type "int" that is NOT required and has a min of 1. If this field is omitted (left as null) and the form is validated it will still show the error of "Should be more than 1", even though null values should be acceptable.

What is desired behavior If a numeric field is not required, null values should be acceptable regardless of min/max values

Link to jsfidle/codepan with sample code https://jsfiddle.net/zacharybeebe/ryzLg4pn/3/

Steps to reproduce or sample See the JS Fiddle

zbeebembg commented 8 months ago

Awesome, thanks for taking care of that quickly!