symfony / ux

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

[Autcomplete] Setting input value in javascript doesn't work #1498

Open tdumalin opened 7 months ago

tdumalin commented 7 months ago

Hi Folks,

I recently figured out that setting value of an autocomplete in javascript doesn't work anymore (I'm pretty sure that it was possible before) I use the dispatchEvent stuff as described in the Live Component documentation: https://symfony.com/bundles/ux-live-component/current/index.html#working-with-the-component-in-javascript

I've create a minimum repo to reproduce the bug: https://github.com/tdumalin/bug-ux-live-plus-autocomplete

All the installation and steps to reproduce the bug are described in README.md

smnandre commented 7 months ago

The value is changed but the component is not re-render. You can test by clicking alternatively on each button and refreshing the page

It is a known problem with TomSelect and LiveComponent... that will probably be fixed in the next release (at the end of the month) !

tdumalin commented 7 months ago

@smnandre it also think that it was due to the LiveComponent,

I tried to remove the {{attributes}} in the templates/components/AdForm.html.twig file which should disable the Live component right ? And the problem was still there ?

Any idea ?

smnandre commented 7 months ago

Sadly no,... the way TomSelect work makes it really difficult to work with :|

carsonbot commented 1 month ago

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

carsonbot commented 3 weeks ago

Just a quick reminder to make a comment on this. If I don't hear anything I'll close this.

carsonbot commented 1 week 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!