You are here

public static function InlineParagraphsWidget::setSetAjax in Paragraphs Sets 8

File

src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php, line 362

Class

InlineParagraphsWidget
Plugin definition of the 'entity_reference paragraphs sets' widget.

Namespace

Drupal\paragraphs_sets\Plugin\Field\FieldWidget

Code

public static function setSetAjax(array $form, FormStateInterface $form_state) {
  $button = $form_state
    ->getTriggeringElement();

  // Go one level up in the form, to the widgets container.
  $element = NestedArray::getValue($form, array_slice($button['#array_parents'], 0, -2));
  return $element;
}