Skip to content

Instantly share code, notes, and snippets.

@dotZoki
Last active November 7, 2017 14:05
Show Gist options
  • Save dotZoki/3dbb087271086c0105710b86b5c3c9cb to your computer and use it in GitHub Desktop.
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 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