hello. i have webform with
.
i open webform in jQuery ui Dialog.
How can i set Select2 for element inside new created ui dialog window?

Thanks.

Comments

dorian76453 created an issue. See original summary.

matsbla’s picture

Status: Active » Fixed
StatusFileSize
new47.1 KB

I don't know how webform works. There is no specific integration for it with this module.

As a workaround you can enable select2 for all dropdowns, go to /admin/config/user-interface/select2boxes and select "Enable select2 widgets for all dropdown and multiselect lists":
Enable select2 widgets for all dropdown and multiselect lists

Hope this helps

denis.dorosh’s picture

Hi, thnx. But it's problem not with webform module, problem with jQuery ui dialog. How i understand, function wich apply Selec2 to select elements can't run inside ui Dialog.
for ex. if i open ui Dialog, there no select2, close dialog and open again, everything is ok.

denis.dorosh’s picture

Status: Fixed » Active
matsbla’s picture

Title: Using Select2 with jQuery ui dialog » Make Select2 work with jQuery ui dialog
Category: Support request » Feature request
Issue summary: View changes
denis.dorosh’s picture

matsbla’s picture

Issue summary: View changes

Okay thanks

denis.dorosh’s picture

Hi. do you have any news ? maybe you can give me some idea how it can be fixed and i'll try to make some patch?

matsbla’s picture

Im not working on this issue, feel free to submit a patch if you find a solution for it.

sergei_semipiadniy’s picture

Hi @dorian76453

I tried to reproduce a bug using fresh Drupal instance with Bartik theme (8.7.10), select2boxes (1.0-alpha3) and webform (5.5) and got no result.

Please could you describe a bit detailed steps to reproduce.

Regards!

sergei_semipiadniy’s picture

Status: Active » Needs review
StatusFileSize
new295.51 KB
new299.85 KB
new306.45 KB
new317 bytes

Finally, found the reason of an issue - default css rule for .ui-dialog class z-index: 1260;.
You can find it in dialog.css file in core themes.

Also attached screens illustrate how z-index impact on select2 element.

Solution - select2 element must have z-index value more than .ui-dialog element has.
Patch enclosed.

Regards!

matsbla’s picture

Category: Feature request » Bug report
Status: Needs review » Fixed

It works great, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.