diff --git a/src/datepicker/bs-datepicker-input.directive.ts b/src/datepicker/bs-datepicker-input.directive.ts index b7e27f70e9..bc1b12c907 100644 --- a/src/datepicker/bs-datepicker-input.directive.ts +++ b/src/datepicker/bs-datepicker-input.directive.ts @@ -71,7 +71,11 @@ export class BsDatepickerInputDirective setDisabledState(isDisabled: boolean): void { this._picker.isDisabled = isDisabled; - this._renderer.setAttribute(this._elRef.nativeElement, 'disabled', 'disabled'); + if (isDisabled) { + this._renderer.setAttribute(this._elRef.nativeElement, 'disabled', 'disabled'); + return; + } + this._renderer.removeAttribute(this._elRef.nativeElement, 'disabled'); } registerOnChange(fn: (value: any) => any): void { diff --git a/src/datepicker/bs-daterangepicker-input.directive.ts b/src/datepicker/bs-daterangepicker-input.directive.ts index 7c2fc0f8f0..d832719d97 100644 --- a/src/datepicker/bs-daterangepicker-input.directive.ts +++ b/src/datepicker/bs-daterangepicker-input.directive.ts @@ -82,7 +82,11 @@ export class BsDaterangepickerInputDirective setDisabledState(isDisabled: boolean): void { this._picker.isDisabled = isDisabled; - this._renderer.setAttribute(this._elRef.nativeElement, 'disabled', 'disabled'); + if (isDisabled) { + this._renderer.setAttribute(this._elRef.nativeElement, 'disabled', 'disabled'); + return; + } + this._renderer.removeAttribute(this._elRef.nativeElement, 'disabled'); } registerOnChange(fn: (value: any) => any): void {