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

Validation : Initially modal and open choice view shows error message if answer is empty. #1514

Closed
santosh-pingle opened this issue Jul 28, 2022 · 10 comments · Fixed by #1904
Assignees
Labels
effort:xsmall Extra small effort - 1 day P2 Medium priority issue type:bug Something isn't working ux

Comments

@santosh-pingle
Copy link
Collaborator

Describe the bug
Modal and open choice view shows error message initially if answer is empty

Component
SDC library.

To Reproduce
Steps to reproduce the behavior:

  1. Open catalog app.
  2. Click on the Modal view.
  3. Click on the gear icon, it opens the bottom sheet.
  4. Click on the “Show error state”

Expected behavior
Initially, it does not show validation error message.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: [e.g. Pixel4a emulator]
  • Android version: [e.g. Settings -> About phone -> Android version]
  • Build number: [e.g. Settings -> About phone -> Build number]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Would you like to work on the issue?
Please state if this issue should be assigned to you or who you think could help to solve this issue.

@jingtang10
Copy link
Collaborator

i think this should be fixed by #1468 . please verify @santosh-pingle

@fredhersch
Copy link
Collaborator

@santosh-pingle can you confirm if this is fixed?

@santosh-pingle
Copy link
Collaborator Author

It's reproducible.

@aurangzaibumer
Copy link
Collaborator

investigating2.mp4

Tried this, it is working fine for me (Not showing validation error on start)

Emulator details
Pixel 4A
Android version 12
sdk_gphone64_x86_64-userdebug 12 SE1A.220203.002.A1 8151367 dev-keys

cc @f-odhiambo

@Tarun-Bhardwaj
Copy link

@santosh-pingle , could you please confirm if this is still reproducible?

@santosh-pingle
Copy link
Collaborator Author

Issue is reproducible.
Me and @aurangzaibumer already had discussion on it.
He already proposed draft, which he supposed to share with @f-odhiambo as per offline discussion with Umer.

@jingtang10
Copy link
Collaborator

@aurangzaibumer do you have any update/ETA for this? thanks

@aurangzaibumer
Copy link
Collaborator

aurangzaibumer commented Oct 4, 2022

@aurangzaibumer do you have any update/ETA for this? thanks

Have investigated the issue and there are two possibilities to solve this problem

  1. to introduce/add a new field on questionnaireItemViewItem that checks if answers is either being modified/add/deleted by the caller. In that way we will able to apply check before calling clearAnswer method. If User has not updated/added/answer in that case we wouldn't call clearAnswer.

  2. to make answers variable in questionnaireitemviewitem nullable and initialize it when answer is either being added/modified/deleted but haven't tried this out because it has a very huge impact on all view factories and its usage is almost on all view factories.

@jingtang10 Please review and suggest which one you think is more suitable.

cc @f-odhiambo

@jingtang10
Copy link
Collaborator

similar to

i think what you need to do is to make sure if the answer is not validated you don't show any error.

@santosh-pingle
Copy link
Collaborator Author

Looking into it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:xsmall Extra small effort - 1 day P2 Medium priority issue type:bug Something isn't working ux
Projects
Status: Complete
5 participants