Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ButtonCollectionType groups splitting #34305

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,8 @@
<div class="{% if use_button_groups %}btn-group {% endif %}group-{{ group }}">
{# Render inline actions #}
{% set inlineButtonsLimit = form.vars.inline_buttons_limit %}
{% for action in form.children %}
{% for button in buttons %}
{% set action = attribute(form, button) %}
{% if inlineButtonsLimit is same as(null) or loop.index <= inlineButtonsLimit %}
{# Remove labels from inline elements if they are not forced #}
{% if form.vars.use_inline_labels %}
Expand All @@ -1528,15 +1529,17 @@
{% endfor %}

{# Render remaining actions in dropdown #}
{% if inlineButtonsLimit is not same as(null) and form.children|length > inlineButtonsLimit %}
{% if inlineButtonsLimit is not same as(null) and buttons|length > inlineButtonsLimit %}
<a id="{{ form.vars.id }}_dropdown" class="btn btn-link dropdown-toggle dropdown-toggle-dots dropdown-toggle-split no-rotate"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
</a>
<div class="dropdown-menu">
{% for action in form.children|slice(inlineButtonsLimit) %}
{% set remainingButtons = buttons|slice(inlineButtonsLimit) %}
{% for button in remainingButtons %}
{% set action = attribute(form, button) %}
{{ form_widget(action, {'attr': {
'class': 'dropdown-item ' ~ action.vars.attr.class|default('')|trim
}}) }}
Expand Down