ux icon indicating copy to clipboard operation
ux copied to clipboard

[LiveComponents] Fix 1384

Open jpvdw86 opened this issue 1 year ago • 3 comments

Q A
Bug fix? yes
New feature? no
Issues Fix #1384
License MIT

jpvdw86 avatar Jan 09 '24 00:01 jpvdw86

Hi @WebMamba, thanks for your response, and I have also looked into the custom hydration function. However, the issue arises from using the built-in LiveCollectionType and LiveCollectionTrait.

As soon as the built-in Add function it used, it create a index => null record in the existing collection. Would be odd to expect everyone to create a custom hydration function when using LiveCollectionType. My opinion is that this should be a basic functionality of the package or needs documented.

We could also choose to add more logic in the LiveCollectionTrait; function addCollectionItem() to create an instance here instead of adding empty value.

jpvdw86 avatar Jan 09 '24 14:01 jpvdw86

We could also choose to add more logic in the LiveCollectionTrait; function addCollectionItem() to create an instance here instead of adding empty value.

It sounds like a better way to go IMHO

WebMamba avatar Jan 09 '24 16:01 WebMamba

Ping! This PR in its current state, I think, is not the correct solution. But we have 2 proposed alternatives:

We could also choose to add more logic in the LiveCollectionTrait; function addCollectionItem() to create an instance here instead of adding empty value.

And

https://github.com/symfony/ux/pull/1385#discussion_r1455917789

What's the best path?

weaverryan avatar Jan 29 '24 14:01 weaverryan