Opened 9 years ago
Closed 9 years ago
#14471 closed defect (invalid)
GFX surface does not support touch events on Android
Reported by: | Damien Mandrioli | Owned by: | Patrick Ruzand |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | DojoX GFX | Version: | 1.7.0 |
Keywords: | gfx mobile | Cc: | |
Blocked By: | Blocking: |
Description
The following mobile sample does not work on Android 2.2 (works on iOS).
<!DOCTYPE HTML> <html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/> <meta name="apple-mobile-web-app-capable" content="yes" /> <title>GFX Mobile Sample</title> <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="parseOnLoad: true"></script> <script language="JavaScript?" type="text/javascript">
require(["dojo/ready", "dojox/mobile", "dojox/mobile/parser", "dojox/mobile/compat", "dojox/mobile/deviceTheme", "dojox/gfx"]); dojo.ready(function(){
var surface = dojox.gfx.createSurface(dojo.byId("gfxContent"), 200, 200); surface.createRect({width: 500, height: 500}).setFill("red"); surface.connect("ontouchstart", function(){dojo.byId("message").innerHTML += "START "}); surface.connect("ontouchend", function(){dojo.byId("message").innerHTML += "END "});
});
</script>
</head> <body style="visibility:hidden;">
<div id="myView" data-dojo-type="dojox.mobile.View" selected="true">
<h1 data-dojo-type="dojox.mobile.Heading">GFX Mobile Sample</h1> <div id="gfxContent"> </div> <div id="message"> </div>
</div>
</body>
</html>
Attachments (1)
Change History (3)
comment:1 Changed 9 years ago by
Owner: | changed from Eugene Lazutkin to Patrick Ruzand |
---|
Changed 9 years ago by
Attachment: | test-14471.html added |
---|
comment:2 Changed 9 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
(from the reporter: "does not work" here means the touch event handlers are not invoked on Android (so, using canvasEvents), while they are in iOS (svg).
The problem is in the name of the events used in this testcase. The connect should be done on 'touchstart'/'touchend' and not 'ontouchstart/ontouchend'.
(see https://dvcs.w3.org/hg/webevents/raw-file/tip/touchevents.html, http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/TouchEventClassReference/TouchEvent/TouchEvent.html#//apple_ref/doc/uid/TP40009358, http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW1)
Once the events names are fixed, the testcase run the same in android as in iOS.
fix the testcase so that it's dojo, amd and gfx compliant.