diff --git a/package.json b/package.json index c90b9b0e6..63be5d712 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,6 @@ "ts-node": "7.0.0", "tslib": "^2.0.0", "tslint": "~6.1.0", - "typescript": "^3.9.7" + "typescript": "^3.6.5" } } diff --git a/projects/dxc-ngx-cdk/src/lib/dxc-date/dxc-date.component.ts b/projects/dxc-ngx-cdk/src/lib/dxc-date/dxc-date.component.ts index 57d41368d..5a451e42f 100644 --- a/projects/dxc-ngx-cdk/src/lib/dxc-date/dxc-date.component.ts +++ b/projects/dxc-ngx-cdk/src/lib/dxc-date/dxc-date.component.ts @@ -153,20 +153,27 @@ export class DxcDateComponent implements OnChanges, OnInit { @HostListener('document:click', ['$event']) public onClickOutsideHandler(event) { - if (event.target.offsetParent !== null) { + if (event.target.offsetParent !== null && event.target.offsetParent.getAttribute("class") !== null) { if(!event.target.offsetParent.getAttribute("class").includes('mde-popover-panel') && !event.target.offsetParent.getAttribute("class").includes('mat-calendar-period') && !event.target.offsetParent.getAttribute("class").includes('mat-calendar-table')){ - if (this._isCalendarOpened) { - if (!this._isOpenClicked && !this._isSelectingDate) { - this.closeCalendar(); - } else { - this._isOpenClicked = false; - this._isSelectingDate = false; - } - } + this.checkOpenCalendar(); } } + else{ + this.checkOpenCalendar(); + } + } + + private checkOpenCalendar(){ + if (this._isCalendarOpened) { + if (!this._isOpenClicked && !this._isSelectingDate) { + this.closeCalendar(); + } else { + this._isOpenClicked = false; + this._isSelectingDate = false; + } + } } public openCalendar(event: any) { diff --git a/tsconfig.json b/tsconfig.json index 058b8ddb5..cbf759e45 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, - "module": "es2020", + "module": "es2015", "allowSyntheticDefaultImports": true, "moduleResolution": "node", "emitDecoratorMetadata": true,