ux
ux copied to clipboard
[Autcomplete] Setting input value in javascript doesn't work
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
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) !
@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 ?
Sadly no,... the way TomSelect work makes it really difficult to work with :|