ux icon indicating copy to clipboard operation
ux copied to clipboard

[Live] Investigate resetting form values when underlying "data" is modified

Open weaverryan opened this issue 3 years ago • 3 comments

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
}

weaverryan avatar Oct 18 '22 14:10 weaverryan

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Apr 26 '24 12:04 carsonbot

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

carsonbot avatar May 11 '24 07:05 carsonbot

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!

carsonbot avatar May 25 '24 14:05 carsonbot