Skip to content
Snippets Groups Projects
Commit 2d06a768 authored by Andy Marquis's avatar Andy Marquis
Browse files

Fixes #3421649 unable to add additional fields.

parent d3c0f876
No related branches found
Tags 8.x-2.0-alpha3
No related merge requests found
......@@ -215,14 +215,9 @@ class CustomItem extends FieldItemBase {
'#description' => $this->t('These can be re-ordered on the main field settings form after the field is created'),
'#prefix' => '<div id="' . $wrapper_id . '">',
'#suffix' => '</div>',
'#states' => [
'visible' => [
'select[data-id="custom-field-storage-clone"]' => ['value' => ''],
],
],
'actions' => [
'#type' => 'actions',
],
],
'actions' => [
'#type' => 'actions',
],
];
......@@ -261,6 +256,12 @@ class CustomItem extends FieldItemBase {
'#prefix' => '<div class="messages messages--warning" role="alert" style="display: block;">',
'#suffix' => '</div>',
];
// Add states to items.
$element['items']['#states'] = [
'visible' => [
'select[data-id="custom-field-storage-clone"]' => ['value' => ''],
],
];
}
}
......@@ -432,12 +433,14 @@ class CustomItem extends FieldItemBase {
'callback' => [$this, 'actionCallback'],
'wrapper' => $wrapper_id,
],
'#states' => [
];
if (!empty($sources)) {
$element['actions']['add']['#states'] = [
'visible' => [
'select[data-id="custom-field-storage-clone"]' => ['value' => ''],
],
],
];
];
}
}
$form_state->setCached(FALSE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment