Search widget behavior - Calcite Example

387
2
Jump to solution
03-20-2019 12:24 PM
ZorbaConlen1
Occasional Contributor III

I'm noticing an odd quirk when using the 4x Calcite maps sample, search widget. It is initially collapsed - when you expand it, there is no problem - enter search term, and hit the search icon to execute the search, and all good. The widget collapses. On next use though, when you expand, if the search term had not been cleared after previous use, it will automatically zoom back to that address or search result.

Not a great user experience, I would think. The user probably wants to enter a new search term at this point. Not seeing a way to disable this.

Anyone know if there is an easy way to deal with it? And for esri, is this a bug or by design?

Here is the sample - ArcGIS API for JavaScript Sandbox 

Thanks

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

This seems like an issue with the design of the Calcite Maps search expand/collapse behavior.  The standard JSAPI search widget is designed to perform a search whenever the search button is clicked. So in your scenario if the previous search is not cleared and you click the search button to expand the search text box then it will re-run the search and display the results. 

This behavior also shows up the first time you expand search when you see the 'Please enter a search term' message. If you look at the standard search box you'll see that when you first click in the box to search you don't get that message: 

Search Widget | ArcGIS API for JavaScript 4.10 

You can submit an issue for this at the GitHub repo for the calcite-maps project located here: GitHub - Esri/calcite-maps: A Bootstrap theme for designing, styling and creating modern map apps. 

View solution in original post

2 Replies
KellyHutchins
Esri Frequent Contributor

This seems like an issue with the design of the Calcite Maps search expand/collapse behavior.  The standard JSAPI search widget is designed to perform a search whenever the search button is clicked. So in your scenario if the previous search is not cleared and you click the search button to expand the search text box then it will re-run the search and display the results. 

This behavior also shows up the first time you expand search when you see the 'Please enter a search term' message. If you look at the standard search box you'll see that when you first click in the box to search you don't get that message: 

Search Widget | ArcGIS API for JavaScript 4.10 

You can submit an issue for this at the GitHub repo for the calcite-maps project located here: GitHub - Esri/calcite-maps: A Bootstrap theme for designing, styling and creating modern map apps. 

ZorbaConlen1
Occasional Contributor III

Ok, I'll submit the issue. Thanks.

0 Kudos