Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

Commit 67b7e6f

Browse files
committed
Merge pull request #26 from martinsik/master
Fixed touch event detection
2 parents cc441e3 + 619acfc commit 67b7e6f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/NgGrid.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,8 @@ export class NgGrid {
819819
}
820820

821821
private _getMousePosition(e: any): {left: number, top: number} {
822-
if (e.originalEvent && e.originalEvent.touches) {
823-
var oe = e.originalEvent;
824-
e = oe.touches.length ? oe.touches[0] : oe.changedTouches[0];
822+
if (e instanceof TouchEvent) {
823+
e = e.touches.length > 0 ? e.touches[0] : e.changedTouches[0];
825824
}
826825

827826
var refPos = this._ngEl.nativeElement.getBoundingClientRect();

0 commit comments

Comments
 (0)