Autocomplete: can't render options when extending Tom Select #2949
Unanswered
noneofyourbusinessbaby
asked this question in
Questions & Answers
Replies: 1 comment 1 reply
-
Hi! Given the comment from https://github.com/symfony/ux/blob/2.x/src/Autocomplete/assets/src/controller.ts#L260-L262 and examples in https://tom-select.js.org/examples/remote/, can you try to replace your arrow function |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi UX team 👋
I'm working with
@symfony/ux-autocomplete
(with AssetMapper + Stimulus) and having trouble getting options to render when using either the customload()
function or static data. I might be doing somthing wrong but can't find it.What I'm doing
I'm customizing the options in a Stimulus controller using the
autocomplete:pre-connect
event, reffering to https://symfony.com/bundles/ux-autocomplete/current/index.html#extending-tom-select.Here's my controller:
This how I use it in my form :
This is the relevant part of composer.json:
What I have checked
The callback() is called with an array of valid items. But nothing appears in the dropdown, even though autocomplete:connect fires and no errors are shown.
JSON format is correct
searchField is set to text, and items match the query
The dropdown does not populate
The Tomselect object is correctly initialized upon connection.
Thanks for the awesome tooling, any advice appreciated !
PS. This is an oversimplification of my code, I could have used the
autocomplete_url
option for now. The endpoint I meant to use expects multiple query parameters.Beta Was this translation helpful? Give feedback.
All reactions