Custom Fields
Re-Envisioned
Support Meta Box Geolocation Geolocation does not work with cloned fields

  • Creator
    Topic
  • #3175
    alpha.media
    Participant

    The geolocation plugin breaks when used for a cloneable group of location fields in two ways:

    • New cloned groups are not autocompleted, as the Location.init() function is only called on page load. In addition, there's no way to fix this without modifying the plugin's JS file, as the entire JS plugin is wrapped in an IIFE and thus there's no way for other JS on the page to access its scope to re-call Location.init() when a new group is added.
    • When one cloned group has an autocomplete item selected, it populates not only the fields in that group, but also the corresponding fields in every other group.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #3178
    alpha.media
    Participant

    I've figured out fixes for both issues: the first problem can be fixed by re-calling Location.init() when a new group is added, and the second problem can be fixed by making the selectors on lines 105 and 107 of mb-geo.js match ".rwmb-group-clone" as well as ".rwmb-group-wrapper", as .rwmb-group-wrapper is not present around cloned groups.

    #3181
    Anh Tran
    Keymaster

    Thanks a lot! I will forward this to Tan Nguyen, our developer, to update the Geolocation extension.

    #3808
    Tan Nguyen
    Participant

    Thanks Cole, I've pushed a new release 😉

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Geolocation does not work with cloned fields’ is closed to new replies.