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
When I declare placeChangedCallback=(action "placeChanged") I get TypeError: Cannot read property 'apply' of undefined. and when I use placeChangedCallback='placeChanged' it doesn't get called at all. Is there something I need to do special if I am creating a search bar component that is going to be used else where? The logic for the action is defined in my component js file. I am also noticing the same behavior with the focusOutCallback
Here is a snippet:
Template (search-bar-address):
<pid=“message”>Message: {{message}}</p>
<p>Full adddress from JSON sent to the callback: {{{fullAddress}}}</p>
<p>Clean string: {{cleanFullAddress}}</p>
<p> Model address: {{address}}</p>
<divid=“search-bar” data-google-auto="{{googleAuto}}">
<labelclass=“visually-hidden” for=“input-search”>Add a new address</label>
{{place-autocomplete-fieldid=“input-search”
value=addresshandlerController=thisplaceholder=“Addanewaddress”
inputClass= ‘place-autocomplete–input’
placeChangedCallback= “addressChanged”
focusOutCallback=“done”
restrictions=googleMapsRestrictionswithGeoLocate=true}}
<prestyle=“font-size: 6px;”>
{{placeJSON}}
</pre>
googleMapsRestrictions: { country: ‘us’, },
fullAddress: null,
googleAuto: null,
action: { done()
{ console.log(“Reached”); },
addressChanged(place) { console.log("***********"+place);
}
}
Where it is implemented
{{search-bar-addressid="search-bar-component"}}
The text was updated successfully, but these errors were encountered:
It is a little bit complicate to read the code you pasted, but, I created this simple gist that show you how to use it. It looks super simple, but it should work:
Basically, as long as you have defined the action in the component it should work. As personal comment, just try to avoid using that handlerController, I made a big mistake adding that when I create this project and it is very likely that I am going to remove it in the near future.
When I declare placeChangedCallback=(action "placeChanged") I get TypeError: Cannot read property 'apply' of undefined. and when I use placeChangedCallback='placeChanged' it doesn't get called at all. Is there something I need to do special if I am creating a search bar component that is going to be used else where? The logic for the action is defined in my component js file. I am also noticing the same behavior with the focusOutCallback
Here is a snippet:
The text was updated successfully, but these errors were encountered: