Wondering if it's possible to cancel a search within the search widget (ArcGIS JavaScript API 4.24) based on the text in the search widget text area before it is sent to an online source?
I'm able to trap the search when it starts, but there isn't an event to cancel/abort from yet. I don't want to use the 'search-complete' event since it's already too late at that point.
searchWidget.on("search-start", function (event) {
if (searchWidget.searchTerm == "my search term") {
//Cancel the search
}
});
The goal is to interrogate the search string for a specific value and cancel the search to perform a different action. TLDR: Would like to listen for a local coordinate input x,y using a regex. If matches the pattern, don't send a search, just pan/zoom the map (since map is in a local coordinate system as well). I've also looked at reactiveUltils, but can't seem to figure out how to cancel the search.