Skip to content

Commit bd3f6eb

Browse files
authored
Merge pull request #305 from swiety85/298-element_style-is-undefined-error---fix-2
fix: fix element.style is undefined error
2 parents 46a5d9f + 7baa71c commit bd3f6eb

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)