Last active
November 7, 2017 14:05
-
-
Save dotZoki/3dbb087271086c0105710b86b5c3c9cb to your computer and use it in GitHub Desktop.
Your select2 dropwdown doesn't look OK in modal on bootstrap (v3) maybe?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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() | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment