diff -u b/core/modules/filter/src/Element/TextFormat.php b/core/modules/filter/src/Element/TextFormat.php --- b/core/modules/filter/src/Element/TextFormat.php +++ b/core/modules/filter/src/Element/TextFormat.php @@ -165,8 +165,7 @@ } } - // Set the #states property of the filter format element to the same value - // as the value element, if the value element has #states set. + // If the value element has #states set, copy it to the format element. if (isset($element['value']['#states'])) { $element['format']['#states'] = $element['value']['#states']; } diff -u b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php --- b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php @@ -88,10 +88,10 @@ $this->assertNotEmpty($checkbox_unchecked_element); $checkbox_visible_element = $page->findField('checkbox_visible_when_checkbox_trigger_checked'); $this->assertNotEmpty($checkbox_visible_element); - $text_format_invisible_when_checkbox_trigger_checked_value = $page->findField('text_format_invisible_when_checkbox_trigger_checked[value]'); - $text_format_invisible_when_checkbox_trigger_checked_format = $page->findField('text_format_invisible_when_checkbox_trigger_checked[format]'); - $this->assertNotEmpty($text_format_invisible_when_checkbox_trigger_checked_value); - $this->assertNotEmpty($text_format_invisible_when_checkbox_trigger_checked_format); + $text_format_invisible_value = $page->findField('text_format_invisible_when_checkbox_trigger_checked[value]'); + $this->assertNotEmpty($text_format_invisible_value); + $text_format_invisible_format = $page->findField('text_format_invisible_when_checkbox_trigger_checked[format]'); + $this->assertNotEmpty($text_format_invisible_format); // Verify initial state. $this->assertTrue($textfield_invisible_element->isVisible()); @@ -101,8 +101,8 @@ $this->assertFalse($checkbox_checked_element->isChecked()); $this->assertTrue($checkbox_unchecked_element->isChecked()); $this->assertFalse($checkbox_visible_element->isVisible()); - $this->assertTrue($text_format_invisible_when_checkbox_trigger_checked_value->isVisible()); - $this->assertTrue($text_format_invisible_when_checkbox_trigger_checked_format->isVisible()); + $this->assertTrue($text_format_invisible_value->isVisible()); + $this->assertTrue($text_format_invisible_format->isVisible()); // Change state: check the checkbox. $trigger->check(); @@ -114,8 +114,8 @@ $this->assertTrue($checkbox_checked_element->isChecked()); $this->assertFalse($checkbox_unchecked_element->isChecked()); $this->assertTrue($checkbox_visible_element->isVisible()); - $this->assertFalse($text_format_invisible_when_checkbox_trigger_checked_value->isVisible()); - $this->assertFalse($text_format_invisible_when_checkbox_trigger_checked_format->isVisible()); + $this->assertFalse($text_format_invisible_value->isVisible()); + $this->assertFalse($text_format_invisible_format->isVisible()); } /**