I'm attempting to upgrade a web app from 4.12 to 4.24, and like usual, it seems that every single thing in Javascript API has been changed in a breaking way.
But one of the many issues i'm running into is this: The Search widget in Javascript API 4.24 is not firing the "select-result" event for me. It fires all the other events, but not this one. So i can't pan to an address.
Here's a minimal code snippet for the search widget:
var locatorSearchWidget = new Search({
container: "searchWidgetDiv",
view: mapVw,
searchAllEnabled: false,
popupEnabled: true,
popupOpenOnSelect: true,
resultGraphicEnabled: false
});
locatorSearchWidget.on("select-result", function (event) {
console.log("The selected search result: ", event);
});
I'm not seeing any errors displayed in the console. The Search widget just never calls the event.
The network log shows the following correct webservice requests from the Search widget:
https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?location=%7B%22spatialReference%22%3A%7B%22wkid%22%3A2926%7D%2C%22x%22%3A1276481.1570000001%2C%22y%22%3A229067.00050000002%7D&maxSuggestions=6&outSR=%7B%22latestWkid%22%3A2926%2C%22wkid%22%3A2926%7D&text=13559%2016t&f=json
https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?SingleLine=13559%2016th%20Ave%20NE%2C%20Seattle%2C%20WA%2C%2098125%2C%20USA&location=%7B%22spatialReference%22%3A%7B%22wkid%22%3A2926%7D%2C%22x%22%3A1276481.1570000001%2C%22y%22%3A229067.00050000002%7D&magicKey=dHA9MCNsb2M9MTI0NzA2NDUjbG5nPTM0I2ZhPTQ3MTg1OTIjaG49MTM1NTkjbGJzPTEwOTo1MTAyODI2MA%3D%3D&maxLocations=6&outFields=Addr_type%2CMatch_addr%2CStAddr%2CCity&outSR=%7B%22latestWkid%22%3A2926%2C%22wkid%22%3A2926%7D&f=json
And they appear to be returning correct json results. But the Search widget apparently just goes off into lala land after the findAddressCandidates response.
Is there any obvious thing i'm doing wrong?