Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#17720 closed defect (wontfix) triggers onClick twice on iPad

Reported by: Mando Owned by: Sebastien Brunot
Priority: undecided Milestone: tbd
Component: DojoX Mobile Version: 1.9.2
Keywords: Cc:
Blocked By: Blocking:


On iPad (model md516C/A, Version 7.0.3) using Safari the ToolBarButton? triggers the "onClick" twice.

-Load up the included test page -click the button -you get the alert msg, but the button still shows its "selected color" -you touch anywhere on the screen and the alert triggers again

If you sent the alert with a setTimeout, then both messages happen right away.

Its the only iOS device I have, and don't have a mac, so can't really debug much further...

Attachments (2)

test.html (1.5 KB) - added by Mando 8 years ago.
test_fixed.html (1.5 KB) - added by phucnpm 6 years ago.

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by Mando

Attachment: test.html added

comment:1 Changed 8 years ago by Patrick Ruzand

Owner: set to Sebastien Brunot
Status: newassigned

comment:2 Changed 8 years ago by Sebastien Brunot

What I notice is a second touchStart event catched by the toolbar button touch start handler when the user press the alert "OK" button.

For the record, it seems that jquery-mobile encounters the same issue:

comment:3 Changed 8 years ago by Sebastien Brunot

My guess is that the problem only occurs when displaying an alert in the onClick callback, and this is a known iOS issue (you find reference to it for both sencha and jquery-mobile, for example). I suppose you're doing this while "debugging" your application but do not really intend to use an alert in your production app ?

A fix might be possible using the identifier property of the touch events on iOS, to ignore events triggered twice (this is what happens in this situation), but I'm not sure that would be usefull for any production use case...

One alternative solution you may use to debugging with alert is to log messages to the console, or to a DIV in your HTML page acting as a console if you do not have access to the javascript console in your development environment.

Last edited 8 years ago by Sebastien Brunot (previous) (diff)

comment:4 Changed 8 years ago by Sebastien Brunot

Resolution: wontfix
Status: assignedclosed

Changed 6 years ago by phucnpm

Attachment: test_fixed.html added


comment:5 Changed 6 years ago by phucnpm


  • handle click on domNode instead of toolbar button widget
    on(testMe.domNode, 'click', testClick);
Note: See TracTickets for help on using tickets.