From 0e2730a45ead783ab22809336b82802ff4657bea Mon Sep 17 00:00:00 2001 From: "Engin.Diri" Date: Thu, 23 Jun 2016 15:46:44 +0200 Subject: [PATCH] https://github.com/valor-software/ng2-file-upload/issues/272 --- components/file-upload/file-drop.directive.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/file-upload/file-drop.directive.ts b/components/file-upload/file-drop.directive.ts index a918adf..1492f31 100644 --- a/components/file-upload/file-drop.directive.ts +++ b/components/file-upload/file-drop.directive.ts @@ -50,8 +50,10 @@ export class FileDropDirective { @HostListener('dragleave', ['$event']) public onDragLeave(event:any):any { - if (event.currentTarget === (this as any).element[0]) { - return; + if ((this as any).element) { + if (event.currentTarget === (this as any).element[0]) { + return; + } } this._preventAndStop(event);