Quellcode durchsuchen

Revert "Always add 'form-control' class to select boxes"

This reverts commit 796ebd23c5243bdb9f16ab9c9bfe7dad92b86d51.
Thomas Rabaix vor 11 Jahren
Ursprung
Commit
ee232aac7e
1 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  1. 3 1
      Resources/views/Form/form_admin_fields.html.twig

+ 3 - 1
Resources/views/Form/form_admin_fields.html.twig

@@ -106,7 +106,9 @@ file that was distributed with this source code.
         {% endfor %}
         </ul>
     {% else %}
-    {% set attr = attr|merge({'class': attr.class|default('') ~ ' form-control'}) %}
+    {% if sonata_admin.admin and not sonata_admin.admin.getConfigurationPool().getOption('use_select2') %}
+        {% set attr = attr|merge({'class': attr.class|default('') ~ ' form-control'}) %}
+    {% endif %}
     <select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
         {% if empty_value is not none %}
             <option value="">