Skip to content

Commit

Permalink
Merge pull request #305 from swiety85/298-element_style-is-undefined-…
Browse files Browse the repository at this point in the history
…error---fix-2

fix: fix element.style is undefined error
  • Loading branch information
swiety85 authored Oct 9, 2018
2 parents 46a5d9f + 7baa71c commit bd3f6eb
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 bd3f6eb

Please sign in to comment.