-
-
Notifications
You must be signed in to change notification settings - Fork 384
Closed
Description
I've followed documentation for extending TomSelect with a custom Stimulus controller.
https://symfony.com/bundles/ux-autocomplete/current/index.html#extending-tom-select
However, when I added the attr option:
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'class' => Food::class,
'attr' => [
'data-controller' => 'custom-autocomplete',
],
]);
}
the select element became a regular select instead of a TomSelect.
The only way I got it to work was by adding both my custom Stimulus controller and the default controller, like this:
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'class' => Food::class,
'attr' => [
'data-controller' => 'custom-autocomplete symfony--ux-autocomplete--autocomplete',
],
]);
}
I am unsure if the above is the correct way to use custom controllers and documentation is incorrect or if this is a bug?
matt9mg, jlucki, techie42 and damonsson
Metadata
Metadata
Assignees
Labels
No labels