Skip to content

Conversation

@msayoung
Copy link
Member

@msayoung msayoung commented Dec 1, 2022

No description provided.

@msayoung msayoung merged commit 3298557 into 1.x Dec 5, 2022
@Adnan-cds
Copy link
Contributor

Just wanted to say that this has broken the LocalGov Address lookup Webform element :( I am yet to figure out the cause.

@msayoung
Copy link
Member Author

msayoung commented Dec 6, 2022

sorry @Adnan-cds - shall we roll it back?

@Adnan-cds
Copy link
Contributor

Nothing to be sorry about :) Let me try to figure out if the problem is in localgov_forms or in localgov_base_preprocess_container().

@Adnan-cds
Copy link
Contributor

Hmm... tricky one. And will remain so until this has been fixed in core.

The following change at least allows the address lookup element to work. But it is possible there are other forms which may still be affected. Which is why I am not offering this as a blanket solution. Could you please check if it retains the accessibility improvements?

diff --git a/localgov_base.theme b/localgov_base.theme
index 2e46107..4616a26 100644
--- a/localgov_base.theme
+++ b/localgov_base.theme
@@ -123,10 +123,10 @@ function localgov_base_preprocess_container(&$variables) {
     $id = $variables['element']['#id'];
     if ($id == 'edit-actions') {
       $id .= '--' . Crypt::randomBytesBase64(8);
+      $variables['attributes']['id'] = $id;
+      $variables['attributes']['data-drupal-selector'] = $id;
+      $variables['element']['#attributes']['data-drupal-selector'] = $id;
+      $variables['element']['#id'] = $id;
     }
-    $variables['attributes']['id'] = $id;
-    $variables['attributes']['data-drupal-selector'] = $id;
-    $variables['element']['#attributes']['data-drupal-selector'] = $id;
-    $variables['element']['#id'] = $id;
   }
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants