Skip to content

Instantly share code, notes, and snippets.

@M0r13n
Created June 17, 2020 11:22
Show Gist options
  • Save M0r13n/3067cab5e4e2431b13ca376f0cc29fb9 to your computer and use it in GitHub Desktop.
Save M0r13n/3067cab5e4e2431b13ca376f0cc29fb9 to your computer and use it in GitHub Desktop.
Change Select2 Height and Width for Flask Admin

Usage

Simply modify the Admin base html file and customize the select2-results and select2-results class in your css.

{% extends 'admin/base.html' %}
{% block head_css %}
{{ super() }}
<style>
/* Set the max height of Select2 dropdowns to approx 14 elements */
.select2-results {
max-height: 400px !important;
}
.select2-container {
width: 400px !important;
}
</style>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment