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

[File Upload UI/UX] Default to Initial Value when Navigating to Multiple File Attachments #7818

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

bivanalhar
Copy link
Contributor

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:

  • Navigating from No/Single Attachment to Multiple Attachment -> initial value of max attachments will be set to 3
  • Navigating from No Attachment to Single/Multiple Attachment -> initial value of max attachment size will be set to 10

- whenever user navigates to multiple file attachments, it will never show 1
- therefore, if user edit the question, and it's initially single file attachment / no attachment, it will default to 3
- upon saving, nothing changes; if the user's final option is single -> will go to 1, multiple -> whatever user is typing, and if none -> 0
Copy link

@adi-herwana-nus adi-herwana-nus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described.

When user saves max attachments with a valid value (e.g. 7), switches to Single Attachment, then switches back to Multiple Attachment, saved value will be restored.

@adi-herwana-nus adi-herwana-nus merged commit 8fe15eb into master Mar 5, 2025
14 checks passed
@adi-herwana-nus adi-herwana-nus deleted the bivan/text-response-qn-ui-change branch March 5, 2025 08:38
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