diff --git a/core/misc/states.js b/core/misc/states.js
index 7399aacb38a157a0cc62584b1d9e3fc1efbca638..218b89268884845728161ab769ec77e5e8743fb9 100644
--- a/core/misc/states.js
+++ b/core/misc/states.js
@@ -93,16 +93,15 @@
    */
   Drupal.behaviors.states = {
     attach(context, settings) {
-      const elements = once('states', '[data-drupal-states]', context);
-      const il = elements.length;
-
+      const $states = $(context).find('[data-drupal-states]');
+      const il = $states.length;
       for (let i = 0; i < il; i++) {
         const config = JSON.parse(
-          elements[i].getAttribute('data-drupal-states'),
+          $states[i].getAttribute('data-drupal-states'),
         );
         Object.keys(config || {}).forEach((state) => {
           new states.Dependent({
-            element: $(elements[i]),
+            element: $($states[i]),
             state: states.State.sanitize(state),
             constraints: config[state],
           });
@@ -121,7 +120,7 @@
    *
    * @constructor Drupal.states.Dependent
    *
-   * @param {{state: Drupal.states.state, constraints: *, element: (*|jQuery|HTMLElement)}} args
+   * @param {object} args
    *   Object with the following keys (all of which are required)
    * @param {jQuery} args.element
    *   A jQuery object of the dependent element
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php
index 2624a15ce36ca2a7a165e2d74ca2f0c59c9f5fd4..ab7425a252d8008c1806ac0e6f8490f48999073c 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php
@@ -27,7 +27,7 @@ class JavascriptStatesTest extends WebDriverTestBase {
   /**
    * {@inheritdoc}
    */
-  protected static $modules = ['form_test', 'big_pipe'];
+  protected static $modules = ['form_test'];
 
   /**
    * {@inheritdoc}