-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List of result autocomplete google maps API can't be selected in Sheet Component #2192
Comments
Why are you using sheet for this? Seems like a combobox could be good for this https://ui.shadcn.com/docs/components/combobox Anyway, could you make a code sandbox so we can reproduce and see? |
Hi @lucasprins
|
@tegarmonster did you find a work around for this? I'm having the same problem with the Dialog component. This is a similar issue: #2155 |
Ben's comment fixed the issue for me. I tested both Dialogs and Sheets and made some minor modifications. I have an useEffect(() => {
setTimeout(() => (document.body.style.pointerEvents = ""), 0)
}, []) Then on onInteractOutside={(e) => {
const hasPacContainer = e.composedPath().some((el: EventTarget) => {
if ("classList" in el) {
return Array.from((el as Element).classList).includes("pac-container")
}
return false
})
if (hasPacContainer) {
e.preventDefault()
}
}} |
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you. |
For other people that have come here because of the same issue but in the shadcn Drawer (which uses radix under the hood), nothing else worked to me other than using this, so basically thanks so much to the original poster which I believe is Ben radix-ui/primitives#1859 (comment), this just targets the item instead of the container. And no need to use modal={false}.
and in the autocomplete component, to allow the click to go through to the autocomplete items (again thanks to the original poster):
|
thanks @kaydenthomson and @dertuman ! |
+1 for @kaydenthomson / @dertuman solution. My head was scratched! |
Thanks @kaydenthomson / @dertuman your solution works perfect! In my case I'm using the StandaloneSearchBox component from @react-google-maps/api. And then in mi component I added And now it's working perfect! I waste a lot of time looking for fix it before I red your messages. |
Hey Ricardo thanks for the kind message, very appreciated and glad this helped! |
Hi,
I'm using component Sheet, and add google maps component to SheetContent.. the google component is work, but when I want to select the result of autocomplete, the list cannot be selected
this is because CSS on Sheet component?
The text was updated successfully, but these errors were encountered: