diff --git a/templates/forms/fields/select_optgroup/select_optgroup.html.twig b/templates/forms/fields/select_optgroup/select_optgroup.html.twig
index dae4348f..f7164b8e 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 %}
-