Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/Shows dependent questions of multiple_checkboxes fields #211

Merged
merged 4 commits into from
Mar 12, 2024

Conversation

NuriaExtremadouro
Copy link
Contributor

Description

  • Fixes a bug by which the dependent questions of multiple checkboxes weren't showing.

Related Issue

  • Found when working on ALD-22.

Motivation and Context

  • We had a multiple checkbox field with a dependent question that should show when we select the "Other" checkbox.
  • When we selected the "Other" checkbox, the dependent question wasn't showing. As in, the multiple checkboxes field wasn't triggering the ConditionalQuestion because no state changes were detected.
  • But if we made a selection in any other type of field (such as a select) that had its own dependent questions, it would show the dependent questions of the multiple checkboxes as well. As in, triggering the select field was triggering ConditionalQuestion method. And that execution would show any dependent questions that should be visible, including the one from the multiple checkboxes.
  • The reason was because the onChange event of the QuestionMultipleCheckboxes was set to execute disableOthers on a given condition. However, even though this condition was working, it was still causing the form to not detect any changes on the multiple checkboxes. Setting the onChange event to anything would keep causing this bug, so now the Checkbox component is configured conditionally.

How Has This Been Tested?

Verified that both the dependentQuestions and the disableOthers configs work for the multiple checkboxes.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@inigomarquinez inigomarquinez merged commit 98dfeb6 into main Mar 12, 2024
5 checks passed
@inigomarquinez inigomarquinez deleted the fix-dependent-question-for-multiple-checkboxes branch March 12, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants