Closed
Description
The form events page indicate
"At this point, you cannot add or remove fields to the form."
when describing the SUBMIT
event. It then follows up with an example listener that the Form component provides:
The Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener subscribes to the FormEvents::SUBMIT event in order to remove the fields that need to be removed whenever manipulating a collection of forms for which allow_delete has been enabled.
Indeed, when looking at the code for that listener, you can see that it is removing fields from the form, which the docs indicate cannot be done.
If someone confirms this is indeed an error, I'll create a PR.