Select to view content in your preferred language

Map click event not firing on android when using dojox.mobile.View

5804
13
Jump to solution
09-24-2015 10:22 AM
BillDaigle
Frequent Contributor

I am trying to use the dojox.mobile framework to build a mobile friendly app.  However, as soon as I add a require for "dojox/mobile/View", the map stops registering click events reliably on Android devices.  It seems like it is an API issue, because if I roll back to API 3.10, it works fine.

Here is a jsFiddle that demonstrates the problem: http://jsfiddle.net/f1wt0yjq/

In order to see the problem on a desktop, you will need to view it in Android device using Chromes developer tools.  When you click the map using an IOS device or windows, you get a "map clicked" in the console.  The same is not when using an android device.

0 Kudos
1 Solution

Accepted Solutions
BillDaigle
Frequent Contributor

Alright.  Finally got it working.  The key is setting window.document.dojoClick to false.

Here is a jsfiddle that seems to work on all emulated devices.

http://jsfiddle.net/8m8y6gea/8/

View solution in original post

0 Kudos
13 Replies
ChrisSmith7
Honored Contributor

Bill,

I tried this on my end and could see the clicks registered in console when targeting 3.14 and emulating a Samsung Galaxy S4.

0 Kudos
RickeyFight
MVP Regular Contributor

Using Chrome developer tools I emulated every type of touch device and it does not work.

0 Kudos
ChrisSmith7
Honored Contributor

UA spoofing issue on my end. Reloaded and it no longer works.

0 Kudos
BillDaigle
Frequent Contributor

Are you refreshing the browser when you switch devices?  That is required on my end. If I do so, it works in the Apple devices, but not the Samsung or Google Nexus devices. 

0 Kudos
RickeyFight
MVP Regular Contributor

Ok, So when I refresh the page the only one that does not work is the Laptop with touch.

I get these errors

0 Kudos
ChrisSmith7
Honored Contributor

I noticed there are some console errors only present when emulating:

Also, I was able to get 2 map clicks, randomly, but could not muster more.

0 Kudos
ChrisSmith7
Honored Contributor

And those console errors just look related to jsfiddle... Actually, interesting comment in action.js:

// TODO: refactor
// TODO: This code is now legacy code, none of it will make its way into Beta
0 Kudos
BillDaigle
Frequent Contributor

I noticed the errors when emulating as well.  I'm not too concerned about them since they are the same for both apple and android. 

The problem is intermittent.  Once in a while I can get a event to fire, but rarely.  You can view the app I'm working on at this link: Sunrise/Sunset Times by Zone

It works fine on my desktop and on IOS devices, but not on Android.

0 Kudos
RickeyFight
MVP Regular Contributor

Bill,

I have no device besides emulators to try your app at. My dept has only IOS devices, Sorry.

I did get it to work emulated on a desktop as Samsung Galaxy note II.

0 Kudos