symfony / ux

Symfony UX initiative: a JavaScript ecosystem for Symfony
https://ux.symfony.com/
MIT License
851 stars 313 forks source link

[LiveComponent] data-action="live#update" does not accept null values #973

Open nicodemuz opened 1 year ago

nicodemuz commented 1 year ago

Is there a way to send a NULL value with data-action="live#update"?

I have tried the following:

<a href="javascript:void(0);" data-model="categoryId" data-value="" data-action="live#update">All categories</a>
<a href="javascript:void(0);" data-model="categoryId" data-value="NULL" data-action="live#update">All categories</a>
<a href="javascript:void(0);" data-model="categoryId" data-value="~" data-action="live#update">All categories</a>
weaverryan commented 1 year ago

Probably data-value="null" should be the correct syntax or data-value (with no ""). I kind of think the 2nd is better, but we also need a syntax that allows setting true/false values.

Or perhaps this should be a purposeful limitation and we document to use a LiveAction instead (which, indeed, is the work-around that I know @nicodemuz found and used).

carsonbot commented 6 months ago

Hey, thanks for your report! There has not been a lot of activity here for a while. Is this bug still relevant? Have you managed to find a workaround?

carsonbot commented 6 months ago

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 commented 5 months ago

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!