Places Autocomplete JS - The pac-container changed dom-position recently

3,626 views
Skip to first unread message

Johannes Schill

unread,
Jun 29, 2011, 7:02:26 AM6/29/11
to google-map...@googlegroups.com
Hello,

Some time between thursday and today the pac-container with the autocomplete search result, changed its position in the markup. Earlier it was inserted right after the input-text-element its monitoring, but now its added just right before the </body>.

Example.

Earlier:
<body>
  .... irrelevant markup ....
  <input type="text" id="autocomplete-id">
  <div class="pac-container">...</div>
  .... more markup ....
</body>

Today:
<body>
  .... irrelevant markup ....
  <input type="text" id="autocomplete-id">
  .... more markup ....
  <div class="pac-container">...</div>
</body>


Has there been any changes and where can i read about those?

Thanks!

Johannes

en4ce

unread,
Jun 29, 2011, 10:38:44 AM6/29/11
to Google Maps JavaScript API v3
yeah i saw this as well, searched for notices but there are none, but
i think the behavior as it is right now is better then before even
though the styles from the text field are still not applied

Ross Allen

unread,
Jun 29, 2011, 12:36:01 PM6/29/11
to google-map...@googlegroups.com
Noticed this as well, and it started causing the problem I posted about yesterday: http://code.google.com/apis/maps/documentation/javascript/forum.html?place=topic%2Fgoogle-maps-js-api-v3%2FqxcrhCMEEjo%2Fdiscussion

Are you guys able to use the Autocomplete popup when the window's scrollY is greater than 0?

Luke Mahé

unread,
Jun 29, 2011, 6:42:38 PM6/29/11
to google-map...@googlegroups.com
We are looking into the scroll issue.

Thanks.

-- Luke


On Thu, Jun 30, 2011 at 2:36 AM, Ross Allen <rea...@gmail.com> wrote:
Noticed this as well, and it started causing the problem I posted about yesterday: http://code.google.com/apis/maps/documentation/javascript/forum.html?place=topic%2Fgoogle-maps-js-api-v3%2FqxcrhCMEEjo%2Fdiscussion

Are you guys able to use the Autocomplete popup when the window's scrollY is greater than 0?

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/EZ0-DyXGkgIJ.

To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Luke Mahé

unread,
Jun 29, 2011, 6:43:12 PM6/29/11
to google-map...@googlegroups.com
What do you mean by "the styles from the text field are still not applied"?

Thanks

-- Luke


--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.

Johannes Schill

unread,
Jun 30, 2011, 2:44:38 AM6/30/11
to google-map...@googlegroups.com
Does this mean the pac-container is supposed to be right before the closing body-tag in the future or was that change an expected one?

Cheers
Johannes

Luke Mahé

unread,
Jun 30, 2011, 3:12:40 AM6/30/11
to google-map...@googlegroups.com
This change was expected. Release notes will be coming out soon.

-- Luke


Johannes Schill

unread,
Jun 30, 2011, 3:16:47 AM6/30/11
to google-map...@googlegroups.com
Thanks for your quick reply. Last question: will there be an optional "appendTo"-parameter or similar to be able to attach it back to the search-field if needed?

Thanks again.

Johannes


Den torsdagen den 30:e juni 2011 kl. 09:12:40 UTC+2 skrev Luke (Google Employee):
This change was expected. Release notes will be coming out soon.

-- Luke


On Thu, Jun 30, 2011 at 4:44 PM, Johannes Schill <johanne...@gmail.com> wrote:
Does this mean the pac-container is supposed to be right before the closing body-tag in the future or was that change an expected one?

Cheers
Johannes

Den torsdagen den 30:e juni 2011 kl. 00:42:38 UTC+2 skrev Luke (Google Employee):
We are looking into the scroll issue.

Thanks.

-- Luke


On Thu, Jun 30, 2011 at 2:36 AM, Ross Allen <rea...@gmail.com> wrote:
Noticed this as well, and it started causing the problem I posted about yesterday: http://code.google.com/apis/maps/documentation/javascript/forum.html?place=topic%2Fgoogle-maps-js-api-v3%2FqxcrhCMEEjo%2Fdiscussion

Are you guys able to use the Autocomplete popup when the window's scrollY is greater than 0?

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/EZ0-DyXGkgIJ.

To post to this group, send email to google...@googlegroups.com.

To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Luke Mahé

unread,
Jun 30, 2011, 3:36:46 AM6/30/11
to google-map...@googlegroups.com
Currently there is no plan to do that. Can you elaborate more as to why you would want it? 

It can cause issues when trying to display the autocomplete without messing with the styles of that element - this is the reason it got moved out.

-- Luke


Johannes Schill

unread,
Jun 30, 2011, 4:44:00 AM6/30/11
to google-map...@googlegroups.com
It's basically because we use different styles applied to the pac-container, depending on which template is used. Sometimes the pac-container is relatively positioned to another container, sometimes its X pixels wide and sometimes its Y pixels wide, sometimes the top/left-values need to be overridden etc. I suppose i can rewrite my code and work around it by adding a class to the body-tag or to the pac-container itself + some scripting to position the container, but it would have been smooth with an appendTo- and/or optionalCssClass-option to avoid the hacking and keep the markup as free from sin as possible.

Cheers
Johannes

-- Luke



-- Luke



-- Luke



To post to this group, send email to goog...@googlegroups.com.

To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/novijabp8J4J.
To post to this group, send email to google...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.

Luke Mahé

unread,
Jun 30, 2011, 7:24:32 PM6/30/11
to google-map...@googlegroups.com
I would prefer to go down the path of allowing the user to specify classes to be added instead of adding to a specific element that may or may not work cross browser.

-- Luke


On Thu, Jun 30, 2011 at 6:44 PM, Johannes Schill <johanne...@gmail.com> wrote:
It's basically because we use different styles applied to the pac-container, depending on which template is used. Sometimes the pac-container is relatively positioned to another container, sometimes its X pixels wide and sometimes its Y pixels wide, sometimes the top/left-values need to be overridden etc. I suppose i can rewrite my code and work around it by adding a class to the body-tag or to the pac-container itself + some scripting to position the container, but it would have been smooth with an appendTo- and/or optionalCssClass-option to avoid the hacking and keep the markup as free from sin as possible.

Yup as you said, best option for now is to add focus/blur listeners to the input element(s) to add a class name to the body and then having .myclass .pac-container etc.
 
Reply all
Reply to author
Forward
0 new messages