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

[Multiple selection task] Remove focus from "other" text field when "other" is deselected #2399

Open
gino-m opened this issue Mar 20, 2024 · 14 comments
Labels
good first issue type: bug Something isn't working
Milestone

Comments

@gino-m
Copy link
Collaborator

gino-m commented Mar 20, 2024

When "other" option is deselected, either by clicking another radio box (select one) or by deselected the "other" checkbox (select many), focus should be removed from the text box.

We should also ensure that text in the "Other" field is not saved to the db if "Other" isn't selected.

Screen_recording_20240322_160349.webm
@rawbzz
Copy link

rawbzz commented Mar 21, 2024

@gino-m do you have a screenshot of what you're referring to?

@gino-m
Copy link
Collaborator Author

gino-m commented Mar 22, 2024

@gino-m do you have a screenshot of what you're referring to?

Sure! Just added to the description above.

@rawbzz
Copy link

rawbzz commented Mar 22, 2024

@gino-m thank you! I feel like it makes sense to only have the other option text field to show up when someone selects other. That way if they choose option a or b the other text field just disappears cc: @vittorino for his thoughts

@gino-m gino-m added this to the Beta release (18-Jul-24) milestone Apr 17, 2024
@NudurupatiSurya
Copy link
Contributor

Hello @gino-m,

Can I work on this issue?

Thanks,
Surya

@gino-m
Copy link
Collaborator Author

gino-m commented Jun 2, 2024

Yes, please! Can you also verify this is still occurring?

@NudurupatiSurya
Copy link
Contributor

NudurupatiSurya commented Jun 3, 2024

Hi @gino-m,

Thank you! I just verified that the issue is still occurring. Please find the attached screen recording for reference.

Screen_recording_20240603_140323.mp4

To confirm, the expected functionality is that the text box should only be shown when the "Other" option is selected. If the user selects options A or B, the text box should hide. Is that correct, or should the text box be in a disabled state when the user selects options A or B?

Looking forward to your input to ensure I'm moving in the right direction.

Best,
Surya

@gino-m
Copy link
Collaborator Author

gino-m commented Jun 4, 2024

Thank you for confirming.

To confirm, the expected functionality is that the text box should only be shown when the "Other" option is selected. If the user selects options A or B, the text box should hide.

Good question. I think the "Other" behavior should actually be as follows:

  • Entering text into the "Other" textbox causes the "Other" option to be automatically selected.
  • When selecting a different option, the text is left as-is, but isn't saved in the response.

Please let me know if you have any other questions!

@NudurupatiSurya
Copy link
Contributor

Thank you for clarifying! I will have a PR up by Wednesday.

@NudurupatiSurya
Copy link
Contributor

Hello Gino,

Sorry for the delayed response. I checked the current implementation, and the behavior seems correct—entering text into the "Other" textbox selects the "Other" option, and the response is not sent if the "Other" option is not selected.

I observed that the keyboard stays up if we select the "Other" option and then select a different option. Should we make the keyboard hide in this case?

Looking forward to your direction 😊

Best,
Surya

@shobhitagarwal1612
Copy link
Member

Focus from the "other" text should also be removed once any other option is selected.

NudurupatiSurya added a commit to NudurupatiSurya/ground-android that referenced this issue Jun 28, 2024
Fixed this issue: Disabling "other" option doesn't hide/disable "Other" text
@NudurupatiSurya
Copy link
Contributor

Hello @gino-m & @shobhitagarwal1612,

Thank you for your guidance! I have just raised PR #2528 for this issue. Please review it and provide your feedback.

Thanks,
Surya

@jcqli jcqli moved this to Todo in Ground Aug 2, 2024
@gino-m gino-m changed the title [Select one - other] Disabling "other" option doesn't hide/disable "Other" text [Select one - other] Deselecting "other" option doesn't hide/disable "Other" text Aug 22, 2024
@gino-m gino-m changed the title [Select one - other] Deselecting "other" option doesn't hide/disable "Other" text [Multiple selection task] Blue "other" text field when "other" is deselected Dec 3, 2024
@gino-m
Copy link
Collaborator Author

gino-m commented Dec 3, 2024

@NudurupatiSurya I've updated this issue's title and description in case you'd like to try this again! Sorry if it wasn't clear before.

@gino-m gino-m changed the title [Multiple selection task] Blue "other" text field when "other" is deselected [Multiple selection task] Blur "other" text field when "other" is deselected Dec 3, 2024
@gino-m gino-m changed the title [Multiple selection task] Blur "other" text field when "other" is deselected [Multiple selection task] Remove focus from "other" text field when "other" is deselected Dec 3, 2024
@NudurupatiSurya
Copy link
Contributor

@NudurupatiSurya I've updated this issue's title and description in case you'd like to try this again! Sorry if it wasn't clear before.

Hi @gino-m, Sorry for the delayed response. Thank you for updating the issue's title & description. I will update the PR by the end of this week.

@gino-m
Copy link
Collaborator Author

gino-m commented Dec 9, 2024

Hi [@gino-m](https://github.com/gino-m), Sorry for the delayed response. Thank you for updating the issue's title & description. I will update the PR by the end of this week.

Great, please reply here if you have any questions. Feel free to send an early draft PR to get early feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue type: bug Something isn't working
Projects
Status: In Progress
4 participants