ArcGIS for JavaScript - Click event issues in IE 10 and 11

4633
5
07-28-2015 07:56 AM
KaylaFunke
New Contributor

I am using ArcGIS for JavaScript v. 3.13. I am having two issues with click events in Internet Explorer 10 and 11 only (works great in Chrome).

 

The first issue is that on the "dbl-click" event, e.graphic is always undefined when I click a graphic. However on the "mouse-down" event, e.graphic is present as expected. I define the events in normal dojo style:

 

map.on("dbl-down", function (e) {
    //e.graphic === undefined when graphic is clicked
});
map.on("mouse-down", function (e) {
    //e.graphic !== undefined when graphic is clicked
});

 

The second issue is that click events like "dbl-click" and "mouse-down" cease to fire for the polygon currently being edited after I have switched the edit mode from EDIT_VERTICES to MOVE. The events do fire for other parts of the map or other graphics. My goal is to toggle between edit modes by double-clicking the graphic being edited. This works beautifully in Chrome. Here is my code:

   

//Fires first time, does not fire for same graphic after edit mode is changed
map.on("dbl-click", function (e) {
     if (editingEnabled) {
          var state = editToolBar.getCurrentState();
          var editingGraphic = state.graphic;
 
          if (editingGraphic != null) {
                
               if (editingGraphic.geometry.type === "polygon" 
                   && editingGraphic.geometry.contains(e.mapPoint)) {
 
                    if (state.tool == Edit.EDIT_VERTICES) {
                         editToolBar.activate(Edit.MOVE, editingGraphic);
                    } else if (state.tool == Edit.MOVE) {
                         editToolBar.activate(Edit.EDIT_VERTICES, editingGraphic);
                    }
               }
          }
     }
});
 
//Don't zoom if double-clicking a graphic while editing
map.on("mouse-down", function (e) {
     if (e.graphic !== undefined && editingEnabled) {
          map.disableDoubleClickZoom();
     } else {
          map.enableDoubleClickZoom();
     }
});

I would like to know if I am overlooking something or this is a bug with ArcGIS for JavaScript. I only noticed the issues in IE 10 and 11.

0 Kudos
5 Replies
ChrisSmith7
Frequent Contributor

Kayla,

I tried adding some map dbl-click events for the following sample:

ArcGIS API for JavaScript Sandbox

Using IE11, the double-click returns an object when double-clicking on the graphics. It works well when changing edit modes as well (right-clicking on the graphic will change the edit mode). Do you have a compatibility meta tag set anywhere? That has lead to problems for users, including myself, in the past.

0 Kudos
KaylaFunke
New Contributor

No, my application does not run under any compatibility mode (on purpose).

However, that ArcGIS for JS sandbox apparently does. When in the sandbox, it says it is in IE 9 mode when I initially open developer tools (F12). The double-click event for a graphic works as expected as you observed. However when I switch the mode to Edge or 10, e.graphic is undefined.

0 Kudos
TomSellsted
MVP Regular Contributor

Kayla,

Have you tried using 3.14 of the API?  There were several bugs pertaining to clicking and dragging in IE10 and IE11 that have been fixed.

What's new in Version 3.14 | Guide | ArcGIS API for JavaScript

Regards,

Tom

0 Kudos
KaylaFunke
New Contributor

No I haven't tried it yet in my app, but the ArcGIS for JS sandbox mentioned in the earlier post is using 3.14, and I observed the same double-click issue where the graphic is undefined.

0 Kudos
ChenLi3
New Contributor II

I came across the same issue with the second problem Kayla mentioned. Could anyone help confirm that if it is a bug? I created a little sample here to clear this problem. JS Bin - Collaborative JavaScript Debugging 

Thanks

Chen

0 Kudos