Error "Tom Select already initialized on this element" / Access already initialized TomSelect? #260
Replies: 4 comments 5 replies
-
I'm not a vue user but this works in vanilla js: var select = document.getElementById('#my-select');
new TomSelect(select);
var instance = select.tomselect; // existing TomSelect instance |
Beta Was this translation helpful? Give feedback.
-
would be great! im trying to get it to work with vue3 at the moment. would suggest a "integrations" page then when the react / angular / whatevers Q's come in a page can just be added. |
Beta Was this translation helpful? Give feedback.
-
I created a TomSelect component for my app. It does not use a select but only the text field. TL;DR: TomSelect is available as Links: Component and usage example There are custom tag renderers which clutter the component, but it acts as an input field that can be used with Hope this may help ;) EDIT on 2022/08/06: Updated links to a specific commit as TomSelect is not used in the project anymore |
Beta Was this translation helpful? Give feedback.
-
Simple fix for Rails/Stimulus/Tom-Select/Vue Vue
Stimulus controller
Simple form (Rails)
|
Beta Was this translation helpful? Give feedback.
-
How can I access an already existing TomSelect? https://tom-select.js.org/docs/api/ only shows ways to create a new one. But when I do
new TomSelect('#foo', {});
, I'm gettingI think this is the same question that #211 asks ;-)
My use case:
I'm binding my
<select>
to Vue.js, and when I change the value in Vue.js, the TomSelect widget isn't refreshed. More precise: The selected value is only visible in the list after I expanded the widget.Beta Was this translation helpful? Give feedback.
All reactions