Select 2 doesn't work in modal
I am trying to add select2 in a modal but I have this error when I click on the select.
https://ibb.co/qmkcXqF
I am using these
Replies (4)
initialize the variable in js.
$('#kt_docs_select2_country').select2({
templateSelection: optionFormat,
templateResult: optionFormat
});
As seen in the documentation.
Hi,
To use Select2 inside Bootstrap Modal, you should pass data-dropdown-parent="#kt_modal_1"
parameter to Select2 element.
For more info please check the documentation.
Regards.