When the component minlength is used and there are string columns that have no validation, the limit of the column is used as minlength.
The minlength attribute should not be set (or set to 0) if a column has no validation that forces a min length.
the fix is pretty easy:
in lib/simple_form/components/minlength.rb line 6
delete the ' || limit'
which seems to be a left over of copying from maxlength.rb.
This also fixes #1496
Hi @mameier Thanks for the report.
Could you provide a sample application that reproduces the error?
I created a minimal rails app (5.2, ruby 2.4) with just one table and one attribute:
form_sample.zip
If you edit "Shrek" (or add a new Ogar), you can see that the input field has
minlength=255 maxlength=255
I submitted a pull request .
This fix works for me.
Most helpful comment
I created a minimal rails app (5.2, ruby 2.4) with just one table and one attribute:
form_sample.zip
If you edit "Shrek" (or add a new Ogar), you can see that the input field has
minlength=255 maxlength=255