fix: auto-save custom answer before switching question tabs#12537
Open
maharshi365 wants to merge 6 commits intoanomalyco:devfrom
Open
fix: auto-save custom answer before switching question tabs#12537maharshi365 wants to merge 6 commits intoanomalyco:devfrom
maharshi365 wants to merge 6 commits intoanomalyco:devfrom
Conversation
Fixes anomalyco#12536 Fixes anomalyco#8199 When a user types a custom answer in the Question tool and switches tabs without confirming (pressing Enter), the typed text appears in the next question's textarea. This auto-saves the custom answer to the current question's state before switching tabs.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
…tion mode (multi vs single input)
Replaced saveCustomAnswer() with saveCustomAnswerMulti() helper and inlined single-select logic to clarify code paths and eliminate duplication.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12536
Fixes #8199
Problem
When using the Question tool with multiple questions and custom answer options, typed text from one question's custom answer field appears in the next question when switching tabs without confirming (pressing Enter).
Reproduction Steps
Solution
Auto-save any uncommitted custom answer text to the current question's state before switching tabs.
Changes in
selectTab():store.editingis true)store.custom[prevTab]store.answerswith the custom valueeditingstate before switching to new tabThis prevents text from "leaking" to the next question and ensures answers don't disappear on the Confirm screen.
Testing