A bug exists in the Search widget such that when the sources menu is open, and you click the arrow button on the left of the widget (presumably to close it), the menu will close, and then immediately re-open. This can be verified in the sample "Search widget with multiple sources". This behavior has also been present in releases prior to 4.22, but the suggested fix below may not work in anything other than 4.22.
If you have a locally hosted copy of the API, you can fix this problem by doing the following find-and-replace in esri/widgets/Search.js:
Search for:
onfocus:this._clearActiveMenu,afterCreate:G.storeNode,
Replace with:
onfocus:function(){if(this.activeMenu!="source")this._clearActiveMenu();}.bind(this),afterCreate:G.storeNode,
Solved! Go to Solution.
Hi @JoelBennett, good news. We'll have the Search widget enhanced at the next release (4.23, due out in March) so that the expanded dropdown arrow now closes the list of locators instead of closing and then reopening. See it in action here: https://codepen.io/noash/pen/LYOWGGK?editors=1000
Hi @JoelBennett, I'm not sure I understand the issue. The arrow button in the left side of the Search widget is for selecting different locators:
Aloha @Noah-Sager, thanks for the follow-up. To see the issue I'm talking about, (1) click the dropdown arrow so it lists the sources, then (2) without clicking any sources, click the dropdown arrow again. It's expected that the dropdown would close, which it does, but unfortunately, opens again immediately.
Aloha? I wish. It's cold here. Ok, I see what you're talking about now. Let me do some digging.
Hi @JoelBennett, good news. We'll have the Search widget enhanced at the next release (4.23, due out in March) so that the expanded dropdown arrow now closes the list of locators instead of closing and then reopening. See it in action here: https://codepen.io/noash/pen/LYOWGGK?editors=1000
Looks good @Noah-Sager, thanks for the fix and the follow-up!
Excellent! Feel free to accept as solution the above post if you feel I've addressed the issue.
Certainly...will do once I've tested in the 4.23 release.
After testing with 4.23, I've confirmed this one is fixed.
P.S. @Noah-Sager if you'd like an easy kill for the 4.24 bug fix list, this one is still in play.