Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#18322 closed defect (wontfix)

Events dont fire on Android after 1.8.8 upgrade

Reported by: ysazak Owned by: Adrian Vasiliu
Priority: high Milestone: tbd
Component: DojoX Mobile Version: 1.8.8
Keywords: Cc:
Blocked By: Blocking:

Description

In my applicaiton I used to use dojo 1.8.0. Coz of IOS8 problem. I upgraded the dojo framework to 1.8.7 then 1.8.8.

after upgrade, Events work fine on IOS8 Safari. But it doesnt work on android webkit browser and chrome.

Attachments (3)

test_click-ScrollableView.html (3.9 KB) - added by Adrian Vasiliu 5 years ago.
test file for click events on elements inside ScrollableView?
test_click-View.html (4.3 KB) - added by Adrian Vasiliu 5 years ago.
Test for click events with dojox/mobile/View
mobileView.html (5.2 KB) - added by ysazak 5 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 Changed 5 years ago by dylan

Component: GeneralDojoX Mobile
Owner: set to Patrick Ruzand
Priority: undecidedhigh
Status: newassigned

comment:2 Changed 5 years ago by Patrick Ruzand

Owner: changed from Patrick Ruzand to Adrian Vasiliu

Hi,

on which android device(s) do you reproduce the issue ? Which android version ? do you reproduce with one of the dojox/mobile testcases ? if not, a minimal sample reproducing the issue would be a plus. is it using dojox/mobile widgets or just dojo/dijit ?

comment:3 Changed 5 years ago by ysazak

Ive tried several android devices. Some of them are Galaxy Tab 4 Android 4.4.2, S3 Android 4.3

I ve just figured out that this problem occurs when I add an element which has onclick attribute or assigned an click event in scrollableView Example;

<div id="svSingleStartup" data-dojo-type="dojox.mobile.ScrollableView" data-dojo-props="selected: true">
<div id="btnHeaderMenu" onclick="doSomething();"></div>
</div>

comment:4 Changed 5 years ago by Adrian Vasiliu

  • There is indeed a change of behavior between 1.8.0 and 1.8.1 which results in your click listener not being called.
  • This change is unrelated with the changes done in dojo/on for iOS 8 support (#18168).
  • Instead, it is a side-effect of the changes in dojox/mobile/scrollable.js done in https://github.com/dojo/dojox/commit/c753aa06de8f01365731feb32784b3428e165c85 for #15878.
  • Here is why your listener isn't called with Dojo 1.8.1 and later 1.8.x:
    • Since Dojo 1.8.0, dojox/mobile/scrollable.onTouchStart() calls evt.preventDefault() except for form elements (that your DIV is not).
    • In 1.8.0, your click handler is called despite this preventDefault, thanks to a synthetic click event emitted by scrollable.onTouchEnd() specifically for elements which are not form elements (<input>, <button>, <textarea>, or <select> tags).
    • Starting with Dojo 1.8.1, this synthetic event is emitted only if NOT running Android >= 4.1.
    • Hence the behavior your observed with Dojo 1.8.7 and 1.8.8 (with these Dojo versions, the problem exists with any Android >= 4.1).
  • But this code has been modified again for the next major release (1.9), and the issue is not reprodicible anymore with Dojo 1.9.x and Dojo 1.10.x.
  • I think these latest changes (https://github.com/dojo/dojox/commit/f1d399037010cdf7d2e8738336745c3dbac3b073) have not been backported to 1.8.x because they are interdependent with the "dojoClick" mechanism introduced in 1.9 and depend on changes in dojo/touch that do not exist in 1.8.

Suggested ways to make it work for you:

  • Upgrade to Dojo 1.9.x or 1.10.x (ideal solution), or
  • Instead of the DIV you used in your code, use a "form element", that is <input>, <button>, <textarea>, or <select> element (if appropriate), or
  • Use a subclass of ScrollableView? overridding isFormElement(node) such that it returns true for your element.
Last edited 5 years ago by Adrian Vasiliu (previous) (diff)

Changed 5 years ago by Adrian Vasiliu

test file for click events on elements inside ScrollableView?

comment:5 Changed 5 years ago by Adrian Vasiliu

The attached test_click-ScrollableView?.html allows to reproduce the issue with Dojo 1.8.1-1.8.8. It also shows that a form-element such as dojox/mobile/Button does receive the click event.

comment:6 Changed 5 years ago by ysazak

Thanks for your detailed answer.

Ive add prototype patchng for isFormElement functin of scrollableView , then it works. but coz of upgrade from 1.8.0 to 1.8.8 I face one more issue.

in some parts of application I use dojox.mobile.View aswell. But div element's click listener doenst work in here aswell. what cause this problem? do you have any idea?

comment:7 Changed 5 years ago by ysazak

One more question; upgrading to 1.8.8 might cause another problems in my application. How can I make the application work well on IOS8 in 1.8.0?

comment:8 Changed 5 years ago by dylan

Dojo 1.8.0 was released in August 2012, 2 years before iOS was released. Both iOS7 and iOS 8 change many things, so if you want to keep at 1.8.0, you would need to cherry-pick whatever iOS patches found in 1.8.8 you were comfortable backporting. Not that I'd recommend this approach, but we cannot go back in time and fix a version without releasing a new version. 1.8.8 is intended to be the minimal set of changes that fix things reported as bugs on the 1.8.x branch of code. Occasionally a fix causes unexpected regressions.

I would suggest being patient and giving pruzand until next week sometime to review the testcase and to see if he has a suggested fix.

Changed 5 years ago by Adrian Vasiliu

Attachment: test_click-View.html added

Test for click events with dojox/mobile/View

comment:9 Changed 5 years ago by Adrian Vasiliu

in some parts of application I use dojox.mobile.View aswell. But div element's click listener doenst work in here aswell. what cause this problem?

I do not reproduce. See the attached https://bugs.dojotoolkit.org/attachment/ticket/18322/test_click-View.html. This is a variant of my initial test_click-ScrollableView?.html, using dojox/mobile/View instead of dojox/mobile/ScrollableView. (The file loads Dojo 1.8.7 from CDN - not 1.8.8 because this CDN isn't available yet - but you'll find in comment a variant of the loading code - uncommenting it and commenting out the loading from CDN you can use your installed Dojo, such that you can test with Dojo 1.8.8 too).

I've tested it on:

  • Samsung Galaxy S3 Android 4.3 (stock browser and Chrome)
  • Samsung Galaxy S5 Android 4.4.2 (stock browser and Chrome)
  • Nexus 5 Android 4.4.4 (Chrome).

With all these browsers, and with both Dojo 1.8.7 CDN and a local install of 1.8.8, touching the DIVs with onclick produces the expected effect (in this sample, it changes the text of the DIV such that you can see that the click event has been fired and handled by the onclick function).

Feel free to modify this sample, or to create your own sample for reproducing the issue.

Changed 5 years ago by ysazak

Attachment: mobileView.html added

comment:10 Changed 5 years ago by ysazak

the div is capsulated by a scrollablepane in my application. sorry I missed that point. please have a look my test attachment named mobileView.html the first div button doesnt work unless u press on the right buttom edge of it

comment:11 Changed 5 years ago by Adrian Vasiliu

Just as ScrollableView?, ScrollablePane? is a subclass of dojox/mobile/scrollable. Hence, you get again the problem that you avoided for the DIV embedded in a ScrollableView? by overriding ScrollableView?.isFormElement(). Just do the same for ScrollablePane? (override ScrollablePane?.isFormElement()) and it should do the trick.

comment:12 Changed 5 years ago by ysazak

Thanks Adrian, it works.

After upgrade problems dont end. Now I have problem with windows Phone 8.0. I cant scroll down in scrollableview. Please check your mobileView.html example on windows Phone 8.0(HTC).

dojo versions are really unstable!!

comment:13 Changed 5 years ago by Adrian Vasiliu

I'm happy to hear that the solution to the initial problem worked.

After upgrade problems dont end. Now I have problem with windows Phone 8.0.

By upgrade you still refer to the upgrade to Dojo 1.8.8, right? In this case, it goes this way: Dojo 1.8.x has never supported WP8 (see http://livedocs.dojotoolkit.org/releasenotes/1.8#browser-support ). The support for WP8 has been introduced in Dojo 1.9. So you'd need to upgrade to 1.9.x or, better, 1.10.x.

comment:14 Changed 5 years ago by ysazak

thanks for your guidance,

what is the stable version of dojo now? 1.9.5 or 1.10.2?

Coz on below 2 pages stable versions are different.

http://dojotoolkit.org/reference-guide/1.10/releasenotes/ http://download.dojotoolkit.org/

comment:15 Changed 5 years ago by dylan

1.10.2 is the most recent stable release, though 1.9.5, 1.8.7, and 1.7.6 are the most recent stable versions for those earlier releases. I've fixed the discrepancy in the release notes source code, though that won't reflect on the web site until they are re-built.

comment:16 Changed 5 years ago by ysazak

I opened a ticket(#18352) about checkbox element in 1.10.2. But havent got any reply.

Could you help me to solve the issue please?

comment:17 Changed 5 years ago by Adrian Vasiliu

Okay, i'll look into it. Concerning the present ticket, my understanding is that the workaround worked, hence I'm closing the ticket.

comment:18 Changed 5 years ago by Adrian Vasiliu

Resolution: wontfix
Status: assignedclosed

comment:19 Changed 5 years ago by Adrian Vasiliu

my understanding is that the workaround worked

And the issue does not exist with 1.9/1.10.

Note: See TracTickets for help on using tickets.