Loading src/Element/LayoutParagraphsBuilder.php +1 −1 Original line number Diff line number Diff line Loading @@ -250,7 +250,7 @@ class LayoutParagraphsBuilder extends RenderElement implements ContainerFactoryP $build['#attributes']['data-type'] = $entity->bundle(); $build['#attributes']['data-id'] = $entity->id(); $build['#attributes']['class'][] = 'js-lpb-component'; $build['#attributes']['id'] = Html::getUniqueId($entity->id()); $build['#attributes']['id'] = Html::getUniqueId($entity->id() ?? 'new-' . $entity->bundle()); $build['#layout_paragraphs_component'] = TRUE; if ($entity->isNew()) { $build['#attributes']['class'][] = 'is_new'; Loading tests/src/FunctionalJavascript/CorrectRegionTest.php +5 −0 Original line number Diff line number Diff line Loading @@ -49,13 +49,18 @@ class CorrectRegionTest extends BuilderTestBase { // Moves third item to bottom of second region. $this->keyPress('ArrowUp'); $this->assertSession()->assertWaitOnAjaxRequest(); // Moves third item to top of second region. $this->keyPress('ArrowUp'); $this->assertSession()->assertWaitOnAjaxRequest(); // Moves third item to bottom of first region. $this->keyPress('ArrowUp'); $this->assertSession()->assertWaitOnAjaxRequest(); // Moves third item to top of first region. $this->keyPress('ArrowUp'); $this->assertSession()->assertWaitOnAjaxRequest(); $this->keyPress('Enter'); $this->assertSession()->assertWaitOnAjaxRequest(); // Add a fourth item above the third item, which has been moved to the first // region. Ensure the fourth item is correctly added to the first region, Loading Loading
src/Element/LayoutParagraphsBuilder.php +1 −1 Original line number Diff line number Diff line Loading @@ -250,7 +250,7 @@ class LayoutParagraphsBuilder extends RenderElement implements ContainerFactoryP $build['#attributes']['data-type'] = $entity->bundle(); $build['#attributes']['data-id'] = $entity->id(); $build['#attributes']['class'][] = 'js-lpb-component'; $build['#attributes']['id'] = Html::getUniqueId($entity->id()); $build['#attributes']['id'] = Html::getUniqueId($entity->id() ?? 'new-' . $entity->bundle()); $build['#layout_paragraphs_component'] = TRUE; if ($entity->isNew()) { $build['#attributes']['class'][] = 'is_new'; Loading
tests/src/FunctionalJavascript/CorrectRegionTest.php +5 −0 Original line number Diff line number Diff line Loading @@ -49,13 +49,18 @@ class CorrectRegionTest extends BuilderTestBase { // Moves third item to bottom of second region. $this->keyPress('ArrowUp'); $this->assertSession()->assertWaitOnAjaxRequest(); // Moves third item to top of second region. $this->keyPress('ArrowUp'); $this->assertSession()->assertWaitOnAjaxRequest(); // Moves third item to bottom of first region. $this->keyPress('ArrowUp'); $this->assertSession()->assertWaitOnAjaxRequest(); // Moves third item to top of first region. $this->keyPress('ArrowUp'); $this->assertSession()->assertWaitOnAjaxRequest(); $this->keyPress('Enter'); $this->assertSession()->assertWaitOnAjaxRequest(); // Add a fourth item above the third item, which has been moved to the first // region. Ensure the fourth item is correctly added to the first region, Loading