InseeFr / Lunatic

Library of questionnaire components
https://inseefr.github.io/Lunatic/
MIT License
20 stars 21 forks source link

hasPageResponse : currently returns true on component checkBoxGroup if a modality has a value "false" #946

Closed QRuhier closed 4 months ago

QRuhier commented 4 months ago

Feature Description

Currently if a page contains a component checkBoxGroup, having a false value on a modality is considered as a response, so hasPageResponse returns true

Use Case

On Queen we use hasPageResponse to prevent user from going next if the page has no response. On checkBoxGroup if he checks/unchecks a modality, the value changes from null to false. Then it should be considered as non response

Proposed Solution

On checkBoxGroup component, if all values are false of null (and without missing response), hasPageResponse should return false

Alternatives Considered

Additional Context

Priority

Attachments

Related Issues

AnneHuSKa commented 4 months ago

Yes, it would be great (to prevent "misclick" and empty responses)