Skip to content

Instantly share code, notes, and snippets.

@dotZoki
dotZoki / app.js
Last active November 7, 2017 14:05
Your select2 dropwdown doesn't look OK in modal on bootstrap (v3) maybe?
/**
* This has to be done this way - it's fix for bootstrap modal select2 issue
*/
$('.modal select').css('width', '100%');
$('select:not(.normal)').each(function () {
$(this).select2({
theme: "bootstrap", // if you use https://github.com/select2/select2-bootstrap-theme
dropdownParent: $(this).parent()
});
});