open-formulieren / open-forms

Smart and dynamic forms
https://open-forms.readthedocs.io
Other
35 stars 27 forks source link

Selectboxes backend validation does not take `Required` into account #4662

Open stevenbal opened 2 weeks ago

stevenbal commented 2 weeks ago

Product versie / Product version

2.7.6 / latest

Customer reference

No response

Omschrijf het probleem / Describe the bug

I ran into this while looking into https://github.com/open-formulieren/open-forms/issues/4602

Selectboxes that have Required set to False and also have a Minimum selected checkboxes configured to 1 or above still trigger backend validation for minSelectedCount when no options are selected.

image

image

Stappen om te reproduceren / Steps to reproduce

  1. Create a Form with a step that has a Selectboxes field
  2. Leave Required as False and configure a Minimum selected checkboxes of 1 or above
  3. Click Toon formulier, go to the step, leave the selectboxes empty and click next
  4. Observe the error stating that you need to check a minimum number of boxes

Verwacht gedrag / Expected behavior

Since the selectboxes are not required, leaving it empty should be possible

Screen resolution

None

Device

None

OS

None

Browser

No response

joeribekker commented 1 week ago

Estimate: 1 day