You are here

public static function ParagraphsWidget::setSetAjax in Paragraphs Sets 8

File

src/Plugin/Field/FieldWidget/ParagraphsWidget.php, line 462

Class

ParagraphsWidget
Plugin implementation of 'entity_reference_revisions 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;
}