From 342099f73f4c9635d6c196a85344f2ad1ace9298 Mon Sep 17 00:00:00 2001 From: Ryan Boog Date: Fri, 24 Aug 2018 10:46:44 -0500 Subject: [PATCH 1/2] Fixed multiple select optgroup selected bug --- .../forms/fields/select_optgroup/select_optgroup.html.twig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/forms/fields/select_optgroup/select_optgroup.html.twig b/templates/forms/fields/select_optgroup/select_optgroup.html.twig index dae4348f..b4e994d7 100644 --- a/templates/forms/fields/select_optgroup/select_optgroup.html.twig +++ b/templates/forms/fields/select_optgroup/select_optgroup.html.twig @@ -22,7 +22,8 @@ data-key-observe="{{ (scope ~ field.name)|fieldName }}" {% endif %} > - {% if field.placeholder %}{% endif %} + {% set selectedoption = false %} + {% if field.placeholder %}{% endif %} {% for key, optgroup in field.options %} {% set optgroup_label = optgroup|keys|first %} @@ -31,7 +32,7 @@ {%for subkey, suboption in field.options[key][optgroup_label] %} {% set selected = field.selectize ? suboption : subkey %} {% set item_value = field.selectize and field.multiple ? suboption : subkey %} -