Skip to content

Show conditional section/fields upon nested checked box #3011

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

Closed
1 task done
Git-mind opened this issue Aug 11, 2022 · 4 comments
Closed
1 task done

Show conditional section/fields upon nested checked box #3011

Git-mind opened this issue Aug 11, 2022 · 4 comments
Assignees
Labels
any-one-all-of Related to fixing anyOf, oneOf or allOf awaiting response question

Comments

@Git-mind
Copy link

Git-mind commented Aug 11, 2022

Prerequisites

What theme are you using?

material-ui

What is your question?

Description
Suppose I have 2 checkboxes (A and B). Upon checked of B checkbox, it will show another list of checkboxes. Each of these checkbox will show a new section of the form and checking multiple checkboxes will show multiple sections of the form.
The problem I'm facing now is that the second list of checkboxes is not responding to the schema dependencies.

I followed #2625 thread.

Update 1: I have updated the schema and the interface is working as expected. But I keep getting an error in the browser console could not merge subschemas in allOf: Error: No resolver found for key const. You can provide a resolver for this keyword in the options, or provide a default resolver.
Every keystroke and backspace will generate the same error as well which accumulate to more than a thousand errors easily.

I checked #2625 thread. The playground links in this thread have the same error as well.
#2811 seems to be the same issue as me.

Update 2: Tried adding another "Request B - Section C", the form generate this error ignoring oneOf in dependencies because there isn't exactly one subschema that is valid and is not displaying according to the checkboxes. Added the following logic for each pemutations.
"Request B": { "contains": { "const": ["Section A", "Section B"] } "not": { "contains": { "const": ["Section C"] } } }

Added schema code in
Playground Link

image

@Git-mind Git-mind added needs triage Initial label given, to be assigned correct labels and assigned question labels Aug 11, 2022
@Git-mind Git-mind reopened this Aug 11, 2022
@heath-freenome heath-freenome added the any-one-all-of Related to fixing anyOf, oneOf or allOf label Sep 29, 2022
@heath-freenome heath-freenome added awaiting response and removed needs triage Initial label given, to be assigned correct labels and assigned labels Dec 23, 2022
@heath-freenome
Copy link
Member

@Git-mind We recently fixed a bug with allOf merges in 5.0.0-beta.15 and it appears that it may have fixed all your problems. Can you confirm?

@xyy7260
Copy link

xyy7260 commented Mar 10, 2023

@Git-mind That's a lot of code. Is there a better way to do it?

@Git-mind
Copy link
Author

@Git-mind We recently fixed a bug with allOf merges in 5.0.0-beta.15 and it appears that it may have fixed all your problems. Can you confirm?

Based on the previous
Playground link, I can confirm that the issue has been solved. There is no error in the console. Previously, there are same errors in console using the playground as well. I just tested it out and is working as expected. Thank you!

@heath-freenome
Copy link
Member

Closing issue as it is confirmed fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
any-one-all-of Related to fixing anyOf, oneOf or allOf awaiting response question
Projects
None yet
Development

No branches or pull requests

5 participants