Fixed bootstrap-selectpickers on bootstrap 5

This commit is contained in:
Jan Böhmer 2022-07-24 20:23:12 +02:00
parent 5d6f244e71
commit 489f4b939a
5 changed files with 24 additions and 24 deletions

View file

@ -115,3 +115,14 @@
{%- endif -%}
{%- endblock tristate_widget %}
{%- block choice_widget_collapsed -%}
{# Only add the BS5 form-select class if we dont use bootstrap-selectpicker #}
{% if attr["data-controller"] is defined and attr["data-controller"] != "elements--selectpicker" %}
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-select')|trim}) -%}
{% else %}
{# If it is an selectpicker add form-control class to fill whole width #}
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) -%}
{% endif %}
{{- block("choice_widget_collapsed", "bootstrap_base_layout.html.twig") -}}
{%- endblock choice_widget_collapsed -%}