[File Upload UI/UX] Default to Initial Value when Navigating to Multiple File Attachments #7818
+59
−46
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.
Background
When user wants to edit the pre-existing text response question, to modify the file-upload related matters (maximum number of attachments and maximum number of attachment sizes), we encountered unexpected behaviour when we switch over from No/Single Attachment to Multiple Attachments.
For Max Attachments, navigating from No Attachment to Multiple Attachments will have the box of Max Attachment be having number 0. Similarly, navigating from Single Attachment to Multiple Attachments will have that box be filled in with 1. Sometimes, when user navigate to Multiple Attachments, they don't really care about how many attachments they want, and hence proceeding to save the question almost immediately.
We fixed this behaviour by introducing the initial value for both max attachments and also max attachment size upon editing the questions, be it text response or file upload
Approach
Upon editing, we do the following: