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: Handle Parent Conditional Change for Survey #6217

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JiyaGupta-cs
Copy link
Contributor

What this PR does

This PR fixes an issue where conditional questions remain visible even after the user changes their selection in a survey. Previously, when a user selected an option that triggered a conditional question, then switched to a different option, the previously shown conditional question would still be displayed.
The bug was in the handleParentConditionalChange function which manages which conditional questions should be displayed based on selected answers. The function had several issues:

  • Incorrect array manipulation when removing previous answers from the currentAnswers array
  • Logic to identify which conditional questions to show/hide wasn't properly checking for previously selected options

Fixes #6216

Screenshots

Before:

Screencast.from.2025-02-26.00-54-48.webm

After:

Screencast.from.2025-02-26.01-07-14.webm

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.

[BUG]: Conditional Questions still persisting even when answers change and are no longer selected
1 participant