Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address field dissapears on the editor slideout editor when static #69

Closed
myleshyson opened this issue Nov 2, 2022 · 4 comments
Closed
Labels
Bug Report Something isn't working

Comments

@myleshyson
Copy link

myleshyson commented Nov 2, 2022

This one's kind of hard to explain but I'll do my best here. If a user only has view permissions on an element that has a google maps address field, when opening the slide out editor for that element a second time, the field disappears. This does not appear to be an issue when a user has full permissions to edit the element in the slide out editor

Screen.Recording.2022-11-02.at.11.40.21.AM.mov

Craft Pro 4.3.1
Google Maps 4.2.5

@myleshyson
Copy link
Author

I think it has something to do with the way that {% js %} tag is handled for the slide out editor, in templates/address/index.twig.

If I replace that twig tag with the following, the address field loads every time as expected.

{# If the library is loaded, initialize all Address fields #}
{#{% js 'if (window.google) {initAddressField();}' %}#}

<script>
  if (window.google) { initAddressField(); }
</script>

@kylecotter
Copy link

kylecotter commented Feb 14, 2023

Hey @lindseydiloreto, I'm seeing this behavior too, but in a more generic context than the original poster.

For me it's any time a slideout is triggered more than once at the root level, or when a Map field loads via a nested slideout the field doesn't render. Definitely concur it seems related to how the JS gets fired in these contexts.

Thanks!

Craft Pro 4.3.8.2
Google Maps 4.3.1

@lindseydiloreto
Copy link
Collaborator

Hey @myleshyson, thanks for reporting this issue! Sorry this slipped through the cracks.

And thanks for the nudge @kylecotter. This ticket should probably be a high priority (alongside a few other tickets on the Address field).

Thanks also for the code suggestion @myleshyson! I'll give that a shot when I dive in. 👍

@lindseydiloreto lindseydiloreto added the Bug Report Something isn't working label Feb 17, 2023
@lindseydiloreto
Copy link
Collaborator

This has been fixed in v4.3.3. Thanks again for reporting it! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants