Open
Description
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 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);
}
}
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