Javascript API 3x Map Click Event Intermittently Fails to Fire in Chrome Browser

11933
50
Jump to solution
03-25-2021 11:41 AM
Dan
by
Occasional Contributor

 

- Javascript API 3.28

- Chrome 89.0.4389.90

- https://www.bcpao.us/PropertySearch/#/account/2961057

---------------------------------------------------------------------------------------------------

Our public Javascript API  3x web map (“MapView”), in production since 2016, started intermittently failing to fire the map.on(“click”) event in Chrome browser on Windows 10 desktop for some users when inside an iframe.  Other elements within the map (checkboxes, buttons, input, search, zoom, pan, layer toggle, etc.) all work.  I can detect that map_gc is the event target every time, but map.on(“click”) doesn’t always fire. I tried loading the web map into a div instead of an iframe, but the result was the same. When the map is loaded in its own window, it seems to work every time. There are no errors in the console.

The website, map, and all resources are local on a single server.  There is another iframe in a separate tab under the web map tab that contains a Pictometry/Eagleview IPA image viewer that initially has no src, so everything is single domain at that point.  There is a resize event on the iframe to ensure the map fits inside the tabbed panel as the browser window is resized. Sometimes resizing the browser window fixes or breaks the map-click, and sometimes has no affect.  Sometimes it just works and is difficult to break.  Sometimes it breaks every time.

This doesn’t happen on all computers and doesn’t appear to happen in any other browser (Edge, IE11, Firefox, Opera, Brave, Safari, etc.)  It doesn't seem to happen on a tablet (Android or Apple) in Chrome either. 

To see this in action, from the URL included above, click the MapView button above the photo.  Maybe I’ve stared at it too long to see an obvious issue . . .

50 Replies
Dan
by
Occasional Contributor

I confirm that my 3.28 test app mentioned previously that "worked every time" indeed fails every time if the browser scale is set to anything but 100%.  This may have something to do with how JSAPI handles pixel interpolation in Chrome.  I recall many years ago when IE was king that browser scale <> 100% broke our long-retired1990s ESRI MapObjects map.  Strange to see it happening again.

HenryKo2
Occasional Contributor

I can confirm too: changed my monitor scaling to 100%, it works fine. But with any other scaling values, the issue exists.

0 Kudos
BenjaminCumberland
New Contributor III

We attempted the resize concept, but that didn't appear to do anything for us.

0 Kudos
AnandMatam
New Contributor II

We have observed the same at our client's place.

We had many clients report this issue and so far every client's issue has been resolved by refreshing the Chrome profile for their users.

Kind of a strange workaround. But has worked in every case so far.

Could not see any difference in the profiles of people for whom it was working v/s the people for whom it was broken. But recreating the broken profiles worked. Strange!

0 Kudos
Dan
by
Occasional Contributor

This may be an unrelated longshot, but after updating to 3.35, my map.on("click") event fires immediately rather than the delayed action found in 3.28.  I found the post below where the developer changed a setting to make the click fire immediately.  

https://community.esri.com/t5/arcgis-api-for-javascript/map-click-delay/m-p/720270

 

 

0 Kudos
BenjaminCumberland
New Contributor III

We put the user back to a broken state and tried to set the "map.navigationManager.setImmediateClick()". It remained in a broken state, thanks for the idea though.

Dan
by
Occasional Contributor

Also, please see the post below where click event for popup not working.  They, too, mention screen resolution.

https://community.esri.com/t5/arcgis-api-for-javascript/no-popup-info-in-chrome/m-p/1041781

 

0 Kudos
Dan
by
Occasional Contributor

Just an FYI that I spoke with an ESRI tech support person today who informed me that ESRI is now aware of this issue, as they've recently received multiple calls from customers.  Still, the more reports ESRI receives for this issue, the more likely it will receive higher priority.  The ESRI tech support person tested from 3.27 through 3.35 and found that the issue seems to be resolved at 3.31.  I explained that some people are unable to immediately update from 3.30 and earlier due to custom apps breaking.  There is also the possibility that Google will release yet another update for Chrome that fixes this issue.

Dan
by
Occasional Contributor

Another FYI that Google released another update, but it did not fix the problem.  They are now at 89.0.4389.114.

0 Kudos
HenryKo2
Occasional Contributor

Thanks for the update Dan, great to know that Esri is aware of this issue.

I tried the latest Chomre beta version  - Version 90.0.4430.51 (Official Build) beta (64-bit) - this did not work either.

I can also confirm updating our JSAPI from 3.22 to 3.35 has resolved this issue.