Steps to reproduce

  1. Enable the module
  2. Configure an API key
  3. Create a webform
  4. Add a loqate field
  5. View the webform

Expected result

One of the form fields should trigger a lookup

Actual result

No lookup is triggered.
The loqate.js and external scripts are being added to the page, but the JS does not set up any lookups, because no elements have the class "address-lookup".

Perhaps this might be a missing documentation problem rather than a bug?

Comments

malcomio created an issue. See original summary.

malcomio’s picture

Title: No form elements » No form elements trigger a lookup
poornachandran’s picture

The following patch fixes the issue of populating the values. It also fixes the issue in https://www.drupal.org/project/loqate/issues/3032356.

poornachandran’s picture

Status: Active » Needs review
baikho’s picture

Version: 8.x-1.4 » 8.x-1.x-dev
Status: Needs review » Needs work
StatusFileSize
new5.1 KB

Hi @poornachandran,

Thanks for the patch, much appreciated!

I've tested your patch on yet latest release 8.x-1.4. This worked fine and fixes the trigger, but there is a small side effect upon clicking the address causing a search box to disappear (The search box happened to be present in the sidebar in my case).

Re-rolled your patch against the new 8.x-1.x dev branch but the newly found defect is still to be fixed.

baikho’s picture

Priority: Normal » Major
Status: Needs work » Needs review
StatusFileSize
new5.47 KB
new5.42 KB

Whilst revising the patch from #3 and rerolled #6, it seems that a few drastic changes were introduced that are not part of the scope of this issue so they should not be addressed here. These patch changes have been reverted:

The other defect mentioned in #6 was caused by the first option whilst instantiating the JS object: { element: 'search', field: '' }, this has been fixed by using a more specific selector.

Raising priority as well to *Major*.

  • baikho committed 2d2592e on 8.x-1.x
    Issue #3027882 by baikho, poornachandran, malcomio: No form elements...
baikho’s picture

Status: Needs review » Fixed

Committed to dev. Tagging new release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.