Skip to content

Commit 941c035

Browse files
committed
minor #7289 minor #7200 Fix Action Button without label (makraz)
This PR was merged into the 4.x branch. Discussion ---------- minor #7200 Fix Action Button without label Add a condition to check that the content is not empty. Commits ------- fd5098b minor #7200 Fix Action Button without label
2 parents f9aaea9 + fd5098b commit 941c035

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templates/components/Button.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
{% if icon and not withTrailingIcon %}
3939
<twig:ea:Icon name="{{ icon }}" class="btn-icon" />
4040
{% endif %}
41-
{% if block('content') is defined %}
41+
{% if block('content') is defined and block('content') is not empty %}
4242
<span {{ attributes.nested('label').defaults({class: 'btn-label'}) }}>{{ block('content') }}</span>
4343
{% endif %}
4444
{% if icon and withTrailingIcon %}
@@ -62,7 +62,7 @@
6262
{% if icon and not withTrailingIcon %}
6363
<twig:ea:Icon name="{{ icon }}" class="btn-icon" />
6464
{% endif %}
65-
{% if block('content') is defined %}
65+
{% if block('content') is defined and block('content') is not empty %}
6666
<span {{ attributes.nested('label').defaults({class: 'btn-label'}) }}>{{ block('content') }}</span>
6767
{% endif %}
6868
{% if icon and withTrailingIcon %}
@@ -79,7 +79,7 @@
7979
{% if icon and not withTrailingIcon %}
8080
<twig:ea:Icon name="{{ icon }}" class="btn-icon" />
8181
{% endif %}
82-
{% if block('content') is defined %}
82+
{% if block('content') is defined and block('content') is not empty %}
8383
<span {{ attributes.nested('label').defaults({class: 'btn-label'}) }}>{{ block('content') }}</span>
8484
{% endif %}
8585
{% if icon and withTrailingIcon %}

0 commit comments

Comments
 (0)