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

Array Length dependant on FormContext Value #4177

Open
1 task done
selfesteemteam opened this issue Apr 26, 2024 · 0 comments
Open
1 task done

Array Length dependant on FormContext Value #4177

selfesteemteam opened this issue Apr 26, 2024 · 0 comments
Labels
needs triage Initial label given, to be assigned correct labels and assigned question

Comments

@selfesteemteam
Copy link

Prerequisites

What theme are you using?

core

What is your question?

I am using rjsf to insert a sub-form into a much larger form that has fixed questions. I need to be able to control the amount of items inside a custom array field from the outside using formContext.

For context, I am using it as an intake form for a booking system. We allow multiple people to book at once, so I was going to use the array fields to allow employees to make questions that are duplicated for every guest. The array should still have an option to add/remove guests, but it should modify the formContext value so the changes are applied globally and the value can be validated externally.

I tried wrapping the ArrayField field with my own field and setting its minItems and maxItems from the wrapper element, but it did not seem to populate automatically. Would I need to make my own array element?

@selfesteemteam selfesteemteam added needs triage Initial label given, to be assigned correct labels and assigned question labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Initial label given, to be assigned correct labels and assigned question
Projects
None yet
Development

No branches or pull requests

1 participant