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

Bit of a bug in the way checkboxes handle "preventNonResponse" #1482

Open
CarlosNZ opened this issue Mar 10, 2023 · 5 comments
Open

Bit of a bug in the way checkboxes handle "preventNonResponse" #1482

CarlosNZ opened this issue Mar 10, 2023 · 5 comments
Labels
bug Something is broken :( Customer: Fiji

Comments

@CarlosNZ
Copy link
Collaborator

CarlosNZ commented Mar 10, 2023

The preventNonResponse flag is preventing the response from being saved at all when all checkboxes are empty. But there's no visual indication. So if you select, then unselect the checkboxes, then move on/submit, you'll actually be submitting a selected checkbox even if you intended to non select it. (You're not allowed to not select, but there should still be some visual indication)

I think the preventNonResponse flag is actually unncessary -- it can all be done with a validation expression.

The problem with the validation is, the "error" message shows up immediately, which is a bit ugly.

My suggestion would be to ditch the preventNonResponse option and replace it with an onlyValidateOnSubmit option which prevents any validation error appearing until submitting (or moving forward on in a linear application).

@CarlosNZ
Copy link
Collaborator Author

Actually, I can fix the immediate problem just by making it save a null response whenever the user unchecks all boxes and preventNonResponse is enabled. I've fixed that on develop so let's leave that as it is for now.

I have an idea of how to make it not show validation errors until submit/next is pressed, so I'll look into that briefly and make a PR here if it seems worth it.

@fergie-nz
Copy link
Contributor

I'm still able to pass through validation without checking boxes with preventNonResponse = true, and isRequired = true

@CarlosNZ
Copy link
Collaborator Author

I'm still able to pass through validation without checking boxes with preventNonResponse = true, and isRequired = true

@fergie-nz I can't reproduce this on branch build_2023-03-11 or later, with my little fix I made in the weekend. Can you confirm you're using this?

@jagoje
Copy link

jagoje commented May 1, 2023

@CarlosNZ , @fergie-nz - is this one a non-issue now?

@CarlosNZ
Copy link
Collaborator Author

CarlosNZ commented May 1, 2023

I'll need to check. It's not affecting the actual workflows we have in use, but I'll need to confirm how it's working for specific cases before closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken :( Customer: Fiji
Projects
None yet
Development

No branches or pull requests

3 participants