ux icon indicating copy to clipboard operation
ux copied to clipboard

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

Open tdumalin opened this issue 1 year ago • 6 comments

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

tdumalin avatar Feb 15 '24 08:02 tdumalin

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 avatar Feb 15 '24 08:02 smnandre

@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 ?

tdumalin avatar Feb 15 '24 08:02 tdumalin

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

smnandre avatar Feb 15 '24 08:02 smnandre