Select to view content in your preferred language

JSAPI 4.10: Popup Actions now under "..." button

2789
6
01-09-2019 01:34 AM
KevinHaeni
Occasional Contributor

Starting from JSAPI 4.10, all custom actions are now shown under a "..." menu button, which isn't a bad thing, but I think there should be a changable threshold value, for example:

3 actions --> Buttons are directly shown

5 actions --> Buttons appear under "..."

Right now, we have 2 actions (which could be easily displayed as separate buttons), but the user first has to open the menu to find them.

Is there any workaround? Since the markup is removed from the DOM while the menu button isn't toggled, it cannot be done using CSS.

Tags (1)
6 Replies
KellyHutchins
Esri Frequent Contributor

Kevin,

At 4.10 you can't override this behavior but at the next release we are going to add a way to either set a threshold or an option to disable the menu. 

Kelly]

GregMcNamee
Regular Contributor

Hi,

So can you set a threshold or disable this behavior in 4.11? Trying to find in documentation...

Thanks.

Greg McNamee
0 Kudos
GregMcNamee
Regular Contributor

Nevermind. view.popup.actionsMenuEnabled = false; 

Greg McNamee
KellyHutchins
Esri Frequent Contributor

Yep actionsMenuEnabled is what you need. You can use it to show/hide the menu based on the number of actions the selected feature's popup template contains

  view.popup.watch("selectedFeature",(graphic)=>{
     const template =graphic.getEffectivePopupTemplate();
     template.actions.length > 3 ? view.popup.actionsMenuEnabled=true : view.popup.actionsMenuEnabled=false;
  });
     
JackFairfield
Frequent Contributor

Why do the popup action buttons overlap the feature navigation arrows?  This looks like a bug to me.

Try clicking so that multiple features are selected in this sample:

https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=popup-actions

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Jack, 

    This is a bug in 4.11. It will be fixed in 4.12. Until then here is a workaround:

https://community.esri.com/thread/233307-how-to-configure-popup-actions-buttons-in-411#comment-85051...

0 Kudos