symfony / ux

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

[LiveComponet] [Autocomplete] How to set value of autocomplete form field with a LiveAction ? #1073

Closed Wait4Code closed 6 months ago

Wait4Code commented 1 year ago

Hello, Is there a way to change value of an autocomplete form field (ajax-one) with a live component action ?

I've try this :

#[LiveAction]
public function forceEntity(): void {
  $id = 9;
  $this->formValues['entity']['autocomplete'] = $id;
}

HTML returned by this action contains an option with given id but this option is never integrated into tom-select after rerender.

Also, i've noticed a weird behaviour when an autocomplete form field (ajax one) is preset with a value : if I select another value, live component is well updated but if then I select back the initial value, no ajax call to update live component is done...

Any idea ?

Thanks

carsonbot commented 6 months ago

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

carsonbot commented 6 months ago

Friendly ping? Should this still be open? I will close if I don't hear anything.