Places Autocomplete JS v3.5: pac-container not positioned properly

1,046 views
Skip to first unread message

George Calvert

unread,
Oct 15, 2011, 11:11:14 AM10/15/11
to google-map...@googlegroups.com
Styling body{margin: 0 auto; max-width: 800px;} yields a left offset > 0 for the pac-container when the window.width > 800 and the target input.left = 0.  I see this problem in both Chrome and FF (haven't tested IE).

It seems the pac-container's position is being calculated using the window offset of the target -- which works fine until window and body don't share the same origin.

Despite the conclusions reached in Places Autocomplete JS - The pac-container changed dom-position recently), I think all would work better if the API simply inserted the pac-container after the target with no styles set.  Inserting after the target means the container always ends up in a predictable place, one easily found in the DOM no matter when the binding executes in the flow.  Most importantly, leaving all styling to the page would avoid these kind of issues entirely.

Regards,
George
Reply all
Reply to author
Forward
0 new messages