Select to view content in your preferred language

Search Widget setting popupEnabled to false still opening popup

888
5
06-28-2023 12:37 PM
Justin_Greco
Frequent Contributor

I am using the Search widget and do not want to popup to appear after a value is selected.  Setting the enablePopup property to false has no impact.  Neither does setting enablePopup to false on the search source itself.  This seems to be a bug starting at 4.27.  Confirmed through the Search widget with multiple sources  sample by setting enabledPopup to false and switching from 4.27 to 4.26.

0 Kudos
5 Replies
LaurenBoyd
Esri Contributor

Hi @Justin_Greco -

The new view.popupEnabled property (at 4.27) only disables the click event from opening the popup, but the popup is still created for the Search widget to be used.

With the view.popup changes at 4.27, you need to set view.popup = null so that the Search widget won't display the Search results in a popup. See the example here: https://codepen.io/laurenb14/pen/dyQvewZ?editors=1000

Hope this helps!

Lauren
Justin_Greco
Frequent Contributor

Thanks for the quick response.  I did figure it had something to do with the popup changes at 4.27.  Setting the view's popup to null does work in this case, but it would disable popups across the whole app, instead of just for the search widget.

0 Kudos
ReneRubalcava
Honored Contributor
Justin_Greco
Frequent Contributor

So that property should still work on the Search widget?  

0 Kudos
Justin_Greco
Frequent Contributor
Thanks @LaurenBoyd for pointing me in the right direction.  I think this should work.  I added the following to the search-complete event for the Search widget:
 
reactiveUtils.whenOnce(() => search?.view?.popup.visible).then(() => search?.view?.popup.close());
 
This will disable the popups for the Search widget, while keeping them on for the map view.