Skip to content

Commit

Permalink
fix: fix element.style is undefined error
Browse files Browse the repository at this point in the history
Fixes #298
  • Loading branch information
swiety85 committed Oct 9, 2018
1 parent 46a5d9f commit 7baa71c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion projects/angular2gridster/src/lib/utils/draggable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,22 @@ export class Draggable {
}

private fixProblemWithDnDForIE(element: Element) {
if (this.isTouchDevice() && this.isIEorEdge()) {
if (this.isTouchDevice() && this.isIEorEdge() && (<HTMLElement>element).style) {
(<HTMLElement>element).style['touch-action'] = 'none';
}
}

private removeTouchActionNone(element: Element) {
if (!(<HTMLElement>element).style) {
return;
}
(<HTMLElement>element).style['touch-action'] = '';
}

private addTouchActionNone(element) {
if (!(<HTMLElement>element).style) {
return;
}
(<HTMLElement>element).style['touch-action'] = 'none';
}

Expand Down

0 comments on commit 7baa71c

Please sign in to comment.