How to turn selectize input items editable?

I need the elements of the "selectize-input" list to be editable, that is, when I write a name in the text field, a list of countries appears, but once I have selected a country, I can no longer use the delete button to delete the selected country in order to enter a different string. I have to explore a long list to choose another country, and that is quite annoying.

The JavaScript file code is too long, so I can't show it here. I just need some ideas to be able to solve this problem as quickly as possible.

Thanks.

1 answer

  • answered 2019-12-09 12:59 Josep Vidal

    You must insantiate the remove_button plugin as it states in the documentation, inside pluginOptions:

        'pluginOptions' => [
                     // define list of plugins 
                    'plugins' => ['remove_button'],
        ]
    

    But for select list I would personally recommend to switch to Kartik select2, it has too many conveniences to not use it in favour of default plugins.