Skip to content

Conversation

@PardeepSinghBali
Copy link
Contributor

What does this change?

This change ensures that the address dropdown (.js-address-select) is populated immediately after the search button (.js-address-searchbutton) is clicked. Previously, the dropdown did not update in real-time, requiring additional interaction or refreshes.
How does it solve the problem?
Listens for AJAX completion (ajaxComplete event).
Clears and repopulates the dropdown dynamically with returned addresses.
Ensures the dropdown is displayed after the search.

How to test

On this branch (PS_PopulateAddressInDDWithAjax)

Perform an address search.
The dropdown populates instantly with the retrieved addresses.
The reset button and manual entry options should still function as expected.

How can we measure success?

Have we considered potential risks?

If AJAX fails, the dropdown might not populate, but this is handled by adding a fallback message ("No addresses found").

Images

Accessibility

@PardeepSinghBali PardeepSinghBali merged commit aeb1b0e into 1.x Mar 11, 2025
13 of 17 checks passed
@ekes
Copy link
Member

ekes commented Mar 11, 2025

That should probably have got reviewed before merging :-)

@Adnan-cds you still want to look it over?

@Adnan-cds
Copy link
Contributor

I will try to have a look within the next day or so.

@andybroomfield
Copy link
Contributor

Tested with the BHCC geocoder, not seen any issues, but I'm also uncertain what this is changing so I don't know what to check for.

@Adnan-cds
Copy link
Contributor

Hello,
Thanks for providing this fix. I have had a look now. This change is attempting to fix a long standing issue with the localgov_base theme. I would request that you revert this change and try to fix localgov_base.

While this fix works for one Address lookup element, it breaks when there are more than one :(

@Adnan-cds
Copy link
Contributor

Ah, thanks for checking Andy. This issue with localgov_base is becoming a real nuisance.

@andybroomfield
Copy link
Contributor

I was going to say this has started to work with localgov_scarfolk with this fix.

@andybroomfield
Copy link
Contributor

Confirming this is now broken when there are two address lookups on a page.

Screenshot 2025-03-12 at 1 46 21 pm

@PardeepSinghBali
Copy link
Contributor Author

Confirming this is now broken when there are two address lookups on a page.

Screenshot 2025-03-12 at 1 46 21 pm

thanks for confirming, this issue will be resolved in next commit

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.

5 participants