You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using live components on Symfony 6.4 and when I add onUpdated parameters, all methods are triggered when I update just one element
Live Component
#[AsLiveComponent]
class RevenueChart
{
use DefaultActionTrait;
#[LiveProp(writable: true, onUpdated: 'onChangeYear')]
public ?int $currentYear = null;
#[LiveProp(writable: true, onUpdated: 'onChangeTarget')]
public float $currentTarget = 0.0;
public function onChangeTarget($oldValue): void
{
var_dump($oldValue);
}
public function onChangeYear($oldValue): void
{
var_dump($oldValue);
}
}
Hello,
I am using live components on Symfony 6.4 and when I add
onUpdated
parameters, all methods are triggered when I update just one elementLive Component
Twig
<select data-model="on(change)|currentYear" id="year"></select>
<input type="number" data-model="on(change)|currentTarget" class="form-control" id="target" />
I don't know if I'm missing something but it doesn't work in my case
Thanks for your help
The text was updated successfully, but these errors were encountered: