In the process of migrating an app I had built using JSAPI 3.x to 4.x.
Trying to understand why my 'Search' widget shows following events for character as I enter them...
- "search-focus"
- "suggest-start"
- "suggest_complete"
Until I hit my "minCharaters" of 3 suggestion configured in the "SearchSources" and suggestions are displayed. When I now click on one of the suggestions, I get events:
- "search-blur"
- "search-focus"
- "search-start"
But I never see a "search-complete" that would allow me to grab the selected records and its attributes. Instead I get an error:
Search.js:15 Uncaught TypeError: Cannot read properties of undefined (reading 'remove')
at N.clearGraphics (Search.js:15:492)
at N.search (Search.js:16:88)
at D.search (Search.js:147:168)
at D._handleSuggestionClick (Search.js:169:123)
at Object.handleInterceptedEvent ((index):2486:380)
at HTMLLIElement.<anonymous> ((index):2502:456)
Since this looks graphics related, I made sure that I have
resultGraphicEnabled: false,
in my Search() configuration. I had some custom CSS to tweak where this widget lives. But I rolled that back also and it seems to not have fixed things.
Any idea what might be going on here and why I'm seeing this graphics error? Thanks.