vitebonus / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

goog.style.getClientPosition error with touchend event #588

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If the event passed to the function is a touchend event, el.targetTouches is 
empty but the function tries to access el.targetTouches[0]:
 * https://code.google.com/p/closure-library/source/browse/closure/goog/style/style.js#891
 * https://code.google.com/p/closure-library/source/browse/closure/goog/style/style.js#893

Original issue reported on code.google.com by frederic...@gmail.com on 4 Sep 2013 at 10:11

GoogleCodeExporter commented 8 years ago
Attached a patch to handle an empty targetTouches case.

Original comment by frederic...@gmail.com on 4 Sep 2013 at 11:13

Attachments:

GoogleCodeExporter commented 8 years ago
A better solution is to use changedTouches instead of targetTouches. 
changedTouches is defined for touchend and touchcancel events.

See attached patch (replace getClientPosition.touchend.diff)

Original comment by frederic...@gmail.com on 17 Oct 2013 at 7:24

Attachments: