You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was following the library tutorial here - link and copied the code, but it does not work as expected. For the onPlaceChange function, it does not have the "value" attribute. I am not sure how I can retrieve the formattedAddress value from the event. Any help is appreciated!
"use client";import{APILoader,PlacePicker,}from"@googlemaps/extended-component-library/react";exportdefaultfunctionMyPicker(){return(<divclassName="p-5"><APILoaderapiKey="<YOUR-API-KEY>"solutionChannel="GMP_GCC_placepicker_v1"/><PlacePickercountry={["us","ca"]}location-bias="49.28273,-123.12074"// search results biased towards "Vancouver, BC"radius={2000}
className="w-2/5"placeholder="Enter city name e.g. Vancouver, BC"onPlaceChange={(e)=>{// e.target. // This line does not work as expected}}/></div>);}
Stack trace
N.A
The text was updated successfully, but these errors were encountered:
Hi @EthanChen39 I'm having trouble reproducing the issue. Here's a sample nextjs project that uses the Place Picker; mind checking if this is working as expected? Note that the value property will only be defined after user selects a place result from the dropdown.
Environment details
I was following the library tutorial here - link and copied the code, but it does not work as expected. For the
onPlaceChange
function, it does not have the "value" attribute. I am not sure how I can retrieve theformattedAddress
value from the event. Any help is appreciated!Steps to reproduce
Code example
Stack trace
N.A
The text was updated successfully, but these errors were encountered: