[Live] Investigate resetting form values when underlying "data" is modified
Currently, if you trigger a live action where you perform an action that will change the form (e.g. you add a new "item" to a CollectionType), you do this by manipulating the underlying "form values": https://github.com/symfony/ux/blob/2.x/src/LiveComponent/src/LiveCollectionTrait.php#L42
It would be nice if you could modify the data on your underlying entity, and the have the form rebuild from there - e.g.
public function addTodoItem(): void
{
// todoList would be the entity bound to the form
$this->todoList->addItem(new TodoItem());
// that's it: by modifying the underlying entity, the form will naturally render with an additional item
}
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3
Hey,
I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!