kartik-v / yii2-editable

An enhanced editable widget for Yii 2.0 that allows easy editing of displayed data with html inputs, widgets and more.
http://demos.krajee.com/editable
Other
112 stars 55 forks source link

Select2 if used on popover with mutli=true will close on each removing of tag #220

Closed gb5256 closed 1 year ago

gb5256 commented 1 year ago

Prerequisites

Steps to reproduce the issue

Do this:

  $data = [
      "19" => "19th",
      "20" => "20th",
      "21" => "21th",
  ];

    echo \kartik\editable\Editable::widget([
        'name' => 'Century2',
        'inputType' => kartik\editable\Editable::INPUT_SELECT2,
        //'asPopover' => false,
        'displayValue' => '20th',
        'value' => ['20'],
        'options' => [
            'id' => 'ids-id-p',
            'data' => $data,
            'pluginOptions' => [
                'placeholder' => '---', //will throw js error on clear-all if not present
                'dropdownParent' => '#ids-id-p-popover',
                'allowClear' => true,
                'multiple' => true,
                'closeOnSelect' => false,
            ],
        ]
    ]);

Then:

Expected behavior and actual behavior

When I follow those steps, I see the popover closing. It should stay open.

On the otherhand: If you set 'asPopover' => false, then it will work as expected. The form stays open even after removing one item and will only close via the close button or on loosing focus or on clicking outside the form. This is all fine then. But not working if using popover.

Environment

Browsers

Operating System

gb5256 commented 1 year ago

There seems to be a similar issue here: https://github.com/kartik-v/yii2-editable/issues/215

But it is marked as "wontfix".

Question to @kartik-v Why will this not be fixed? I just try to understand the issue at hand. Or is this more select2 related than popover-x?

gb5256 commented 1 year ago

Closing this ticket here as after investigating it, it turns out to be an issue with bootstrap-popover-x.js and not with Editable. I have created a new isssue ticket there to follow-up on this issue:

Issue : https://github.com/kartik-v/bootstrap-popover-x/issues/48