Skip to content

Commit

Permalink
[BUG #8110] workaround for IE8
Browse files Browse the repository at this point in the history
  • Loading branch information
danielwagner committed Apr 28, 2014
1 parent a2e0dac commit 94055d4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions framework/source/class/qx/event/type/Pointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,17 @@ qx.Class.define("qx.event.type.Pointer",
getOriginalTarget : function() {
if (this._native && this._native._original) { // fake pointer events
var orig = this._native._original;
// touch events have a wrong target compared to mouse events
if (orig.type.indexOf("touch") == 0) {
if (orig.changedTouches[0]) {
return document.elementFromPoint(orig.changedTouches[0].clientX, orig.changedTouches[0].clientY);
// In IE8, the original event can be a DispCEventObj which throws an
// exception when trying to access its properties.
try {
// touch events have a wrong target compared to mouse events
if (orig.type.indexOf("touch") == 0) {
if (orig.changedTouches[0]) {
return document.elementFromPoint(orig.changedTouches[0].clientX, orig.changedTouches[0].clientY);
}
}
} catch(ex) {
return qx.bom.Event.getTarget(this._native);
}
return qx.bom.Event.getTarget(orig);
} else if (this._native) { // native pointer events
Expand Down

0 comments on commit 94055d4

Please sign in to comment.