diff -u b/js/paragraphs.js b/js/paragraphs.js --- b/js/paragraphs.js +++ b/js/paragraphs.js @@ -16,6 +16,7 @@ } else { $('.paragraphs-subform').hide(); + $('.paragraphs-nested.paragraphs-subform').show(); $('.paragraphs-behavior').show(); } } diff -u b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php --- b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php +++ b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php @@ -720,11 +720,19 @@ $description = FieldFilteredMarkup::create(\Drupal::token()->replace($this->fieldDefinition->getDescription())); $elements = array(); - $form['perspective_tabs'] = [ - '#type' => 'markup', - '#markup' => '
', - '#weight' => 30, - ]; + + // If the parent entity is paragraph add the nested class if not then add + // the perspective tabs. + if ($items->getEntity()->getEntityTypeId() != 'paragraph') { + $form['perspective_tabs'] = [ + '#type' => 'markup', + '#markup' => '', + '#weight' => 30, + ]; + } + else { + $form['#attributes']['class'][] = 'paragraphs-nested'; + } $id_prefix = implode('-', array_merge($parents, array($field_name))); $wrapper_id = Html::getUniqueId($id_prefix . '-add-more-wrapper'); $elements['#prefix'] = '