Select2 plugin does not function properly in bootstrap modal

posted in: Select2

Yii version 2.0.13.1 Select2 plugin is very useful plugin when you are building the custom application or website. ProblemWhen I use the select2 inside a bootstrap modal. I can not type anything in the input field that attaches to the plugin. CauseThis issue occurs because the Bootstrap modal tends to steal focus from other elements outside of the modal. Since by default, Select2 attaches the dropdown menu to the <body> element, it is considered “outside of the modal”. SolutionAttach the dropdown to … Read More