diff --git a/modules/webform_ui/src/Tests/WebformUiElementPropertiesTest.php b/modules/webform_ui/src/Tests/WebformUiElementPropertiesTest.php
index ca5c07ab..f82952e7 100644
--- a/modules/webform_ui/src/Tests/WebformUiElementPropertiesTest.php
+++ b/modules/webform_ui/src/Tests/WebformUiElementPropertiesTest.php
@@ -24,7 +24,7 @@ class WebformUiElementPropertiesTest extends WebformTestBase {
    *
    * @var array
    */
-  protected static $testWebforms = ['example_layout_basic', 'example_elements', 'example_elements_composite', 'test_element', 'test_element_access', 'test_form_states_triggers'];
+  protected static $testWebforms = ['example_layout_basic', 'example_elements', 'example_elements_states', 'example_elements_composite', 'test_element', 'test_element_access', 'test_form_states_triggers'];
 
   /**
    * {@inheritdoc}
diff --git a/src/Element/WebformElementStates.php b/src/Element/WebformElementStates.php
index a6785da5..992f6b8d 100644
--- a/src/Element/WebformElementStates.php
+++ b/src/Element/WebformElementStates.php
@@ -583,14 +583,21 @@ class WebformElementStates extends FormElement {
             $trigger = $condition['trigger'];
             $value = $condition['value'] ?: TRUE;
             if ($selector && $trigger) {
-              if ($index !== 0 && $operator == 'or') {
-                $states[$state][] = $operator;
+              if ($operator == 'or') {
+                if ($index !== 0) {
+                  $states[$state][] = $operator;
+                }
+                $states[$state][] = [
+                  $selector => [
+                    $trigger => $value,
+                  ],
+                ];
               }
-              $states[$state][] = [
-                $selector => [
+              else {
+                $states[$state][$selector] = [
                   $trigger => $value,
-                ],
-              ];
+                ];
+              }
             }
           }
         }
