InseeFr / Lunatic

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

Radio/checkboxOne/missing : select the selected modality is considered as a value changed #1011

Closed QRuhier closed 3 weeks ago

QRuhier commented 1 month ago

Describe the bug

When a radio/checbboxOne/missing has a selected modality, if you select it again (click/shortcut), it considers that the value changed.

To Reproduce

Steps to reproduce the behavior:

  1. With the survey available here/uploaded in issue
  2. Go to '...'
  3. Click on '....'
  4. See error ...

Expected behavior

Since the value is still the same, it shouldn't be considered as a value changed

Screenshots

If applicable, add screenshots to help explain your problem.

Version where the bug appeared

3.0.0

Browser where the bug was tested

Additional context

Add any other context about the problem here.

QRuhier commented 1 month ago

Leads to unexpected behavior in Queen (auto goNext using the changed values)

ddecrulle commented 3 weeks ago

To address this issue, I propose refactoring the Radio component to use the native input radio. Regarding the checkboxOne component, it's a deprecated component, so I propose to leave it as it is.

For the missing button, you're right, we can add a test before firing the value change.