Skip to content

Commit

Permalink
bug #34811 [TwigBridge] Update bootstrap_4_layout.html.twig missing s…
Browse files Browse the repository at this point in the history
…witch-custom label (sabruss)

This PR was submitted for the master branch but it was merged into the 4.4 branch instead (closes #34811).

Discussion
----------

[TwigBridge] Update bootstrap_4_layout.html.twig missing switch-custom label

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | yes
| New feature?  | no
| License       | MIT

Missing .custom-control-label for bootstrap custom-switch when using .switch-custom class in label_attr

Commits
-------

9347b2e [TwigBridge] Update bootstrap_4_layout.html.twig
  • Loading branch information
fabpot committed Dec 5, 2019
2 parents c3b5ec5 + 9347b2e commit bfe697b
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -242,7 +242,7 @@
{% block checkbox_radio_label -%}
{#- Do not display the label if widget is not defined in order to prevent double label rendering -#}
{%- if widget is defined -%}
{% set is_parent_custom = parent_label_class is defined and ('checkbox-custom' in parent_label_class or 'radio-custom' in parent_label_class) %}
{% set is_parent_custom = parent_label_class is defined and ('checkbox-custom' in parent_label_class or 'radio-custom' in parent_label_class or 'switch-custom' in parent_label_class) %}
{% set is_custom = label_attr.class is defined and ('checkbox-custom' in label_attr.class or 'radio-custom' in label_attr.class or 'switch-custom' in label_attr.class) %}
{%- if is_parent_custom or is_custom -%}
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' custom-control-label')|trim}) -%}
Expand Down

0 comments on commit bfe697b

Please sign in to comment.