Open
Description
I can't seem to get the following to work:
Form Foo with fields:
- A / a checkbox type input
- B / a choice type input
- depends on A, if A is checked, B is not added
->addDependent('B', ['A'], function (DependentField $field, ?bool $checkbox): void { if ($checkbox) { return; } $field->add(ChoiceType::class, /* [...] */); }
- depends on A, if A is checked, B is not added
- C / a text type input
- depends on A, if A is checked, C is not added, depends on B, options change based on the value of B
->addDependent('C', ['A', 'B'], function (DependentField $field, ?bool $checkbox, ?string $choice): void { if ($checkbox) { return; } $field->add(TextType::class, /* [...] */); }
- depends on A, if A is checked, C is not added, depends on B, options change based on the value of B
The above doesn't work though; if I check A, B disappears, but C is still added (or not removed 🤷).
Metadata
Assignees
Labels
No labels