kartik-v / yii2-popover-x

Extended bootstrap popover for Yii 2.0 with modal behavior and various styling options.
Other
23 stars 8 forks source link

Select 2 and popover-x #25

Closed cluwong closed 3 years ago

cluwong commented 3 years ago

Prerequisites

Steps to reproduce the issue

This happens when Select2 widget is placed inside PopoverX widget and when Select2 is used with as input in Editable Column. Select2 widget by itself works fine.

Expected behavior and actual behavior

When I follow those steps, I see...

  1. Select2 dropdown is hiding behind the popover widget.
  2. When trying to type to search for data in dropdown list, entire PopoverX box disappears.
  3. Have tried the solution in https://select2.org/troubleshooting/common-problems by setting dropdownParent property but that does not fix the problem.

I was expecting... Dropdown display inside popoverX widget and I can type to search for data in dropdown list.

Environment

Browsers

Operating System

Libraries

Isolating the problem

kartik-v commented 3 years ago

You need to configure dropdownParent property correctly. Check the 4th example in Select2 Demo Advanced to see Select2 embedded correctly inside Krajee Popover X.

cluwong commented 3 years ago

Have followed the demo - set id for popover-x widget and configured dropdownParent to the id. The behavior is as described above - dropdown box is displayed behind popover-x and popover disappears when typing. The difference spotted is demo uses Select2 4.1.0-rc.0 and my app uses Select2 4.0.13, could this be the reason?

kartik-v commented 3 years ago

It is possible because of the outdated plugin version for select2. Also you may need to check if you have other CSS/JS which is overriding the modal dialog behavior.

The best approach for you is to try with a simple plain install of yii2 with bootstrap 5 and yii2-widget-select2 widget and then add your other themes / extensions one by one to see where it breaks.