From 9e4ab53567c2c2e8df0ebac31ede4c1f1c8cbf9c Mon Sep 17 00:00:00 2001 From: ekes Date: Fri, 28 Nov 2025 14:22:08 +0000 Subject: [PATCH 1/2] Allow Title, Help and Description to be set (overriden). Fixes #122 --- src/Element/AddressLookupElement.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Element/AddressLookupElement.php b/src/Element/AddressLookupElement.php index 88dc0f4..5a933af 100644 --- a/src/Element/AddressLookupElement.php +++ b/src/Element/AddressLookupElement.php @@ -109,6 +109,17 @@ public static function processAddressLookupElement(&$element, FormStateInterface 'class' => ['js-address-searchstring'], ], ]; + // Display title, description and help on the active element. + $properties = [ + '#title' => '#title', + // phpcs:ignore DrupalPractice.General.DescriptionT.DescriptionT + '#description' => '#description', + '#help' => '#help', + ]; + $element['address_search']['address_searchstring'] = array_merge( + $element['address_search']['address_searchstring'], + array_intersect_key($element, $properties) + ); $element['address_search']['address_actions'] = [ '#type' => 'container', From c2464db3633653dc287aeb5efd4436f5ef9f7892 Mon Sep 17 00:00:00 2001 From: ekes Date: Fri, 28 Nov 2025 15:15:44 +0000 Subject: [PATCH 2/2] And the option to hide/place the title. --- src/Element/AddressLookupElement.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Element/AddressLookupElement.php b/src/Element/AddressLookupElement.php index 5a933af..be4bc64 100644 --- a/src/Element/AddressLookupElement.php +++ b/src/Element/AddressLookupElement.php @@ -112,6 +112,7 @@ public static function processAddressLookupElement(&$element, FormStateInterface // Display title, description and help on the active element. $properties = [ '#title' => '#title', + '#title_display' => '#title_display', // phpcs:ignore DrupalPractice.General.DescriptionT.DescriptionT '#description' => '#description', '#help' => '#help',