-
-
Notifications
You must be signed in to change notification settings - Fork 368
Closed
Labels
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.
Activity
smnandre commentedon Jul 24, 2024
This seems to be the same as: #1128
Do you think you could open a PR to fix this bug and merge correctly ?
sabat24 commentedon Jul 24, 2024
Yes. It's a duplicate.
Probably yes. However, I am struggling with a higher priority issue related to Autocomplete and LiveComponent, so I will start to work on this not earlier then 3 weeks.
carsonbot commentedon Jan 25, 2025
Hey, thanks for your report!
There has not been a lot of activity here for a while. Is this bug still relevant? Have you managed to find a workaround?
carsonbot commentedon Feb 8, 2025
Friendly reminder that this issue exists. If I don't hear anything I'll close this.
carsonbot commentedon Feb 22, 2025
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!
Kocal commentedon Jun 13, 2025
Duplicate of #1128
tom_select_options
onAsEntityAutocompleteField
: errorsUncaught TypeError: this.getUrl is not a function
#1128bug symfony#2841 [Autocomplete] Ensure default plugins are nicely mer…