M
M
My joy2020-11-23 12:27:31
Yii
My joy, 2020-11-23 12:27:31

Why isn't the last remaining element of the Select2 multiselect removed?

Hello!

b7e7c13a8abc962df94d8.png

echo Select2::widget([
  'name' => 'AnalyticsSearch[src]',
  'value' => $searchModel->src,
  'data' => Users::getAllAsArray('id', 'login'),
  'options' => ['placeholder' => 'Выбрать...', 'class' => 'grid-filter', 'multiple' => true],
  'pluginOptions' => ['allowClear' => true,],
]);


I am using yii2 Select2 for filtering. When adding new elements - everything is filtered as it should. Also when deleting. Until there is only one option left. Visually, it can be removed by clicking on the cross, but after refreshing the page, this option is still selected. As a result, I do not know how to completely clean the filter. There are no errors in the console.

Let me know if anyone has experienced this

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