Optional search option #274
-
How to disable |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 9 replies
-
I think you are looking for the same thing as I did, which is wanting select options without the input element. You can achieve this by explicitly setting the Example: new TomSelect('#my-select', {
create: false,
highlight: true,
closeAfterSelect: true,
controlInput: null
}); Even though the docs state that |
Beta Was this translation helpful? Give feedback.
-
worked but placeholder now gone ( placeholder attr on select element ) maybe with js placeholder option new TomSelect('#my-select', {
create: false,
highlight: true,
closeAfterSelect: true,
controlInput: null,
placeholder: "test placeholder"
}); |
Beta Was this translation helpful? Give feedback.
-
I spent a bit of time on my own searching on how to disable the search after reading on the available settings on the documentation before ending there, I'm maybe not the only one. I'm wondering why It's my first time using the plugin so I'm not familiar with the historic background, but looks like the In the case of the default value is gonna be set as To summarize I see three different states:
What would be the best solution to allow those three states to be more clear?
What's do you think? The commenting commit mention a plugin and I'm not familiar at all with the effects my propositions could have on the plugin ecosystem, so feedback on that are more than welcome. |
Beta Was this translation helpful? Give feedback.
-
things in
new TomSelect('#tom-select-one', {
render:{
no_results: function( data, escape ){
return '<div class="no-results">change no result render</div>';
},
}
});
new TomSelect('#tom-select-two', {
render:{
no_results: function( data, escape ){
return '<div class="no-results">change no result render repeated</div>';
},
}
});
|
Beta Was this translation helpful? Give feedback.
-
Another possibility, just add readonly:
|
Beta Was this translation helpful? Give feedback.
-
It would be nice if there was a plugin that counts the number of options and if the option count is above a set number, then a search field is enabled. So a tom select with only 10 options would appear as a simple dropdown, but anything with over 11 or more options would have a search box. |
Beta Was this translation helpful? Give feedback.
I think you are looking for the same thing as I did, which is wanting select options without the input element. You can achieve this by explicitly setting the
controlInput
tonull
.Example:
Even though the docs state that
null
is the default, that doesn't seem correct. Probably needs an update there.