Replies: 1 comment
-
|
The PAC container gets its own z-index from Google's library, so it ignores modal stacking context. Here's the fix: Pass the container element to Google's .autocomplete-wrapper {
position: relative;
z-index: 1300; /* higher than modal (usually 1200) */
}
.pac-container {
z-index: 1300 !important;
}Or better - set it up right in your modal: <Dialog style={{ zIndex: 1300 }}>
<div className="autocomplete-wrapper">
<Autocomplete />
</div>
</Dialog>The issue with PAC is Google renders it at |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How can I show Autocomplete results in a modal?
As you can see the
dialogandpac-containerare siblings...which is not adjusting the z-indexI set the input ref as the item in the dialog/modal:
new places.Autocomplete(inputRef.current, options)I don't see any
optionsthat allow you to change the location or custom style.What's really interesting is the PAC
display: nonenever gets removed...and I also notice multiple instances of thepac-containergets into the DOM...I have tried suggestions of manually trying to override the CSS
zIndexbut that doesn't work...Beta Was this translation helpful? Give feedback.
All reactions