Nathalie
Nathalie

Reputation: 111

How do you style the dropdown on Google Places Autocomplete API to be "responsive"?

I have a working searchbox and autocomplete from Google Places API in my website. The problem is that when the search box is too close to the edge of the screen, the autocomplete dropdown displays BELOW and you don't see it.

How to make it responsive? So that when the dropdown will go offscreen it goes to the other side and it's actually visible?

I've seen the documentation here: https://developers.google.com/maps/documentation/javascript/places-autocomplete And I see they have a class for the dropdown "pac-container", but nothing about it.

Does anyone know how to work this around? Thank you!

Upvotes: 1

Views: 1898

Answers (1)

felgharb
felgharb

Reputation: 89

This worked for me :

<style type="text/css">
  .pac-container{
    margin-top: -210px;
  }
</style>

Upvotes: 2

Related Questions