Skip to content

Commit 9e4ab53

Browse files
committed
Allow Title, Help and Description to be set (overriden). Fixes #122
1 parent aea8b6d commit 9e4ab53

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Element/AddressLookupElement.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ public static function processAddressLookupElement(&$element, FormStateInterface
109109
'class' => ['js-address-searchstring'],
110110
],
111111
];
112+
// Display title, description and help on the active element.
113+
$properties = [
114+
'#title' => '#title',
115+
// phpcs:ignore DrupalPractice.General.DescriptionT.DescriptionT
116+
'#description' => '#description',
117+
'#help' => '#help',
118+
];
119+
$element['address_search']['address_searchstring'] = array_merge(
120+
$element['address_search']['address_searchstring'],
121+
array_intersect_key($element, $properties)
122+
);
112123

113124
$element['address_search']['address_actions'] = [
114125
'#type' => 'container',

0 commit comments

Comments
 (0)