@@ -34,7 +34,7 @@ import { IgxInputGroupModule, IgxInputDirective, IgxInputGroupComponent, IgxInpu
3434import { Subject , fromEvent , animationFrameScheduler , interval , Subscription } from 'rxjs' ;
3535import { filter , takeUntil , throttle } from 'rxjs/operators' ;
3636import { IgxOverlayOutletDirective } from '../directives/toggle/toggle.directive' ;
37- import { IgxTextSelectionModule } from '../directives/text-selection/text-selection.directive' ;
37+ import { IgxTextSelectionModule } from '../directives/text-selection/text-selection.directive' ;
3838import {
3939 OverlaySettings ,
4040 IgxOverlayService ,
@@ -144,7 +144,7 @@ const noop = () => { };
144144 ` ]
145145} )
146146export class IgxDatePickerComponent implements IDatePicker , ControlValueAccessor ,
147- EditorProvider , OnInit , AfterViewInit , OnDestroy , AfterViewChecked {
147+ EditorProvider , OnInit , AfterViewInit , OnDestroy , AfterViewChecked {
148148 /**
149149 * Gets/Sets the `IgxDatePickerComponent` label.
150150 * @remarks
@@ -914,10 +914,10 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
914914 * @param date passed date that has to be set to the calendar.
915915 */
916916 public selectDate ( date : Date ) : void {
917- const oldValue = this . value ;
917+ const oldValue = this . value ;
918918 this . value = date ;
919919
920- this . emitValueChangeEvent ( oldValue , this . value ) ;
920+ this . emitValueChangeEvent ( oldValue , this . value ) ;
921921 this . onSelection . emit ( date ) ;
922922 }
923923
@@ -929,9 +929,9 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
929929 * ```
930930 */
931931 public deselectDate ( ) : void {
932- const oldValue = this . value ;
932+ const oldValue = this . value ;
933933 this . value = null ;
934- this . emitValueChangeEvent ( oldValue , this . value ) ;
934+ this . emitValueChangeEvent ( oldValue , this . value ) ;
935935 if ( this . calendar ) {
936936 this . calendar . deselectDate ( ) ;
937937 }
@@ -946,7 +946,7 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
946946 * ```
947947 */
948948 public openDialog ( ) : void {
949- if ( ! this . collapsed ) {
949+ if ( ! this . collapsed || this . disabled ) {
950950 return ;
951951 }
952952
@@ -987,10 +987,12 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
987987 * @hidden @internal
988988 */
989989 public clear ( ) : void {
990- this . isEmpty = true ;
991- this . invalidDate = '' ;
992- this . deselectDate ( ) ;
993- this . _setCursorPosition ( 0 ) ;
990+ if ( ! this . disabled ) {
991+ this . isEmpty = true ;
992+ this . invalidDate = '' ;
993+ this . deselectDate ( ) ;
994+ this . _setCursorPosition ( 0 ) ;
995+ }
994996 }
995997
996998 /**
@@ -1008,10 +1010,10 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
10081010 date . setSeconds ( this . value . getSeconds ( ) ) ;
10091011 date . setMilliseconds ( this . value . getMilliseconds ( ) ) ;
10101012 }
1011- const oldValue = this . value ;
1013+ const oldValue = this . value ;
10121014 this . value = date ;
10131015
1014- this . emitValueChangeEvent ( oldValue , this . value ) ;
1016+ this . emitValueChangeEvent ( oldValue , this . value ) ;
10151017 this . calendar . viewDate = date ;
10161018 this . closeCalendar ( ) ;
10171019 this . onSelection . emit ( date ) ;
@@ -1141,11 +1143,11 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
11411143
11421144 if ( this . disabledDates === null
11431145 || ( this . disabledDates !== null && ! isDateInRanges ( newValue , this . disabledDates ) ) ) {
1144- const oldValue = this . value ;
1145- this . value = newValue ;
1146+ const oldValue = this . value ;
1147+ this . value = newValue ;
11461148
1147- this . emitValueChangeEvent ( oldValue , this . value ) ;
1148- this . invalidDate = '' ;
1149+ this . emitValueChangeEvent ( oldValue , this . value ) ;
1150+ this . invalidDate = '' ;
11491151 } else {
11501152 const args : IDatePickerDisabledDateEventArgs = {
11511153 datePicker : this ,
0 commit comments