File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed
src/Autocomplete/assets/src Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -46,18 +46,21 @@ export default class extends Controller {
4646 #getCommonConfig( ) : Partial < TomSettings > {
4747 const plugins : any = { }
4848
49- // multiple values excepted if this is NOT A select (i.e. input) or a multiple select
50- const isMultiple = ! this . selectElement || this . selectElement . multiple ;
51- if ( ! this . formElement . disabled && ! isMultiple ) {
52- plugins . clear_button = { title : '' } ;
53- }
54-
55- if ( isMultiple ) {
56- plugins . remove_button = { title : '' } ;
57- }
58-
59- if ( this . urlValue ) {
60- plugins . virtual_scroll = { } ;
49+ // automaticly add plugins when NOT explicit configured
50+ if ( ! this . tomSelectOptionsValue || ! this . tomSelectOptionsValue . plugins !== undefined ) {
51+ // multiple values excepted if this is NOT A select (i.e. input) or a multiple select
52+ const isMultiple = ! this . selectElement || this . selectElement . multiple ;
53+ if ( ! this . formElement . disabled && ! isMultiple ) {
54+ plugins . clear_button = { title : '' } ;
55+ }
56+
57+ if ( isMultiple ) {
58+ plugins . remove_button = { title : '' } ;
59+ }
60+
61+ if ( this . urlValue ) {
62+ plugins . virtual_scroll = { } ;
63+ }
6164 }
6265
6366 const config : Partial < TomSettings > = {
You can’t perform that action at this time.
0 commit comments