B
B
baetov2022-03-14 15:08:05
Yii
baetov, 2022-03-14 15:08:05

How to make auto focus in search field in kartik select2?

I use kartik select2, and I want that when you click on the drop-down list, you can immediately start entering, just like in the examples of official documentation, now I have to click on the drop-down list box, then click the search field again with the mouse and start typing letters . The input itself opens in a modal window, but I tried it and without it it still doesn't work as it should.
Here is the code from the form:

<?= $form->field($model, 'client_id')->widget(Select2::classname(), [
                'data' =>  ArrayHelper::map(Client::find()->all(), 'id', 'name'),
                'language' => 'ru',
                'options' => ['placeholder' => 'выберите Контрагента ...'],
                'pluginOptions' => [
                    'allowClear' => true,
                ],
            ]) ?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question