Autocomplete force pac-container above search box
Asked Answered
E

1

12

I am having a hard time figuring out how to do this.

I am using google.map.places.Autocomplete and its all working fine, but due to app/screen sizes the pac-container with the returned search listings is behind the devices virtual keyboard - and thus on about half of the devices I have tested the user can't see the returned address list. Obviously you don't want the pac-container in front of the keyboard because then various keyboard keys will be hidden.

How can I force the pac-container to appear above (and scroll up) the search/input box?

Elohim answered 2/10, 2015 at 14:57 Comment(2)
Maybe you can provide some code, test case to start helping you, because everyone can imagine and create scenario he want !Dorfman
You could try to detect when the keyboard is active, and limit the height of the pac-container to the new window.innerHeight, while making it scrollable so that overflowing results can be found. See this #11600540Gaunt
E
1

The simplest way is to check when the keyboard opens and then minus margin the page a bit.

body.keyboardopen {
     margin-top: -@keyboardheight;
}
Erlond answered 24/10, 2015 at 3:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.