Open
Description
Tested on 2.10.
When creating FormType
:
- Set
autocomplete_url
to some custom url. - Set some custom plugin you want to add via
tom_select_options
$builder->add('field', ChoiceType::class, [
'choices' => [
'Select something' => '',
],
'autocomplete' => true,
'autocomplete_url' => 'custom_url,
'tom_select_options' => [
'plugins' => ['dropdown_input'],
]
]);
- On site open select to choose something and you will get an error in console from ux-autocomplete controller
Uncaught TypeError: this.getUrl is not a function
The error is caused because of that ux-autocomplete controller adds virtual_scroll
as a plugin by default when url
option is set. However providing plugins
option directly overrides it. Knowing that fact I can set of course it manually
'tom_select_options' => [
'plugins' => ['dropdown_input', 'virtual_scroll'],
]
It would be nice if some required default options were merged instead of replacing them. Or at least there may be some information in doc what kind of options should be set to not override those created by ux-autocomplete controller.