diff --git a/src/Element/ComponentForm.php b/src/Element/ComponentForm.php index d26a0b5d96c5b35d3c7c4cb26ff976fcb13fd6b4..89de156be82e3bc4792a0bb9af725fc172c5d587 100644 --- a/src/Element/ComponentForm.php +++ b/src/Element/ComponentForm.php @@ -113,12 +113,12 @@ class ComponentForm extends ComponentFormBase { $element['#source_contexts']['component_id'] = new Context($contextComponentDefinition, $component_id); } if ($initial_component_id === NULL) { - $element["component_id"] = self::expandAjax(self::buildComponentSelectorForm( + $component_selector_form = array_merge(self::buildComponentSelectorForm( $wrapper_id, $component_id - )); + ), ["#ajax_url" => $element["#ajax_url"]]); + $element["component_id"] = self::expandAjax($component_selector_form); } - self::buildComponentForm( $element, $wrapper_id, @@ -241,7 +241,7 @@ class ComponentForm extends ComponentFormBase { '#component_id' => $component_id, '#source_contexts' => $element['#source_contexts'], '#tag_filter' => $element['#tag_filter'], - '#ajax_url' => $element['#ajax_url'] ?? "", + '#ajax_url' => $element['#ajax_url'], '#access' => $element['#render_props'] ?? TRUE, '#default_value' => [ 'props' => $element['#default_value']['props'],