#17720 closed defect (wontfix)
dojox.mobile.ToolBarButton 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: |
Description
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)
Change History (7)
Changed 7 years ago by
comment:1 Changed 7 years ago by
Owner: | set to Sebastien Brunot |
---|---|
Status: | new → assigned |
comment:2 Changed 7 years ago by
comment:3 Changed 7 years ago by
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.
comment:4 Changed 7 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
comment:5 Changed 5 years ago by
solution:
- handle click on domNode instead of toolbar button widget
on(testMe.domNode, 'click', testClick);
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: https://github.com/jquery/jquery-mobile/issues/4686