kartik-v / yii2-widget-select2

Enhanced Yii2 wrapper for the Select2 jQuery plugin (sub repo split from yii2-widgets).
http://demos.krajee.com/widget-details/select2
Other
323 stars 145 forks source link

Style out of place after update to V2.2.3 #346

Closed cwongwpp closed 2 years ago

cwongwpp commented 2 years ago

Prerequisites

Steps to reproduce the issue

Create a multi select field in view:

$data = ['aaaa', 'bbbb', 'cccc (very long very long)', 'dddd (very long text)'];
echo $form->field($model, 'field1')->widget(Select2::classname(), [ 
        'data' => array_combine($data, $data),
        'options' => [
            'placeholder' => 'Select...',
            'multiple' => true,
        ],
    ]);

Expected behavior and actual behavior

When I follow those steps, I see... Selected items aren't aligned to left: screenshot01 When selected items have long text, only 1 is shown, the other one is hidden: screenshot02

I was expecting... (downgrade to V2.2.2) screenshot-222-01 screenshot-222-02

Environment

Browsers

Operating System

Libraries

Isolating the problem

thtmorais commented 2 years ago

I have this problem too.

SegaSh99 commented 2 years ago

I have this problem too

kartik-v commented 2 years ago

Cannot reproduce your issue - seems you are using MULTIPLE select feature. Cross check the demos page for multiple selection where it works fine. You may want to check if you are not having a caching issue on your environment running outdated/stale assets. After update to a new select2 release, clean up web runtime cache and runtime assets and also your browser cache and retry,

cwongwpp commented 2 years ago

While there are no issues from the demo page, this issue is reproducible with a brand new project with just a form. Original tests were done on Chrome, I have now tested on Safari and Firefox as well - no issue with V2.2.2 but same issue with V2.2.3 across these browsers. Runtime assets and caches and browser caches were cleared after updating the lib.

thtmorais commented 2 years ago

https://github.com/kartik-v/yii2-widget-select2/issues/346#issuecomment-1081109263

Yes, i self has many projects using this extensions, and all projects has this problem. Tryed in Google Chrome and Firefox in Ubuntu 20.04 LTS.

sniper888 commented 2 years ago

the demo page work Select2 4.1.0-rc.0, but the composer download Select2 4.0.13 (composer.json "kartik-v/yii2-widget-select2": "@dev", )

I have this problem too I use bs4.x multiple feature with allowClear option