Skip to content

Commit 7baa71c

Browse files
committed
fix: fix element.style is undefined error
Fixes #298
1 parent 46a5d9f commit 7baa71c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

projects/angular2gridster/src/lib/utils/draggable.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,16 +303,22 @@ export class Draggable {
303303
}
304304

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

311311
private removeTouchActionNone(element: Element) {
312+
if (!(<HTMLElement>element).style) {
313+
return;
314+
}
312315
(<HTMLElement>element).style['touch-action'] = '';
313316
}
314317

315318
private addTouchActionNone(element) {
319+
if (!(<HTMLElement>element).style) {
320+
return;
321+
}
316322
(<HTMLElement>element).style['touch-action'] = 'none';
317323
}
318324

0 commit comments

Comments
 (0)