I'm using a google autocomplete input inside angular material Dialog.
When the user scrolls a bit down, material Dialog uses a trick and (according to source):
/** Blocks page-level scroll while the attached overlay is open
.
This in turn adds a top: -1000px
for example to the document element in the html.
Later when the google autocomplete is shown it's .pac-container
class takes this offset into account ( the one on the document
element ).
This causes the dropdown to be in a different location than expected ( not next to the input element to which it is bound ).
I've tried running the dialog in pages with scrolling and without, and that makes the difference.
I dug through the angular components GitHub repository to find the overlay scroll issue. I did not find any configuration that can be passed to Dialog
or to autocomplete
to fix this.