@@ -752,6 +752,8 @@ export class IgxDatePickerComponent extends PickerBaseDirective implements Contr
752752 }
753753 } ) ;
754754
755+ this . setRequired ( ) ;
756+
755757 if ( this . _ngControl ) {
756758 this . _statusChanges$ =
757759 this . _ngControl . statusChanges . subscribe ( this . onStatusChanged . bind ( this ) ) ;
@@ -816,6 +818,7 @@ export class IgxDatePickerComponent extends PickerBaseDirective implements Contr
816818 if ( this . inputGroup . isRequired !== this . required ) {
817819 this . inputGroup . isRequired = this . required ;
818820 }
821+ this . setRequired ( ) ;
819822 } ;
820823
821824 private handleSelection ( date : Date ) : void {
@@ -862,7 +865,10 @@ export class IgxDatePickerComponent extends PickerBaseDirective implements Contr
862865
863866 this . _overlayService . onOpened . pipe ( ...this . _overlaySubFilter ) . subscribe ( ( eventArgs ) => {
864867 this . opened . emit ( eventArgs as IBaseEventArgs ) ;
865- this . _calendar ?. daysView ?. focusActiveDate ( ) ;
868+ const errors = DateTimeUtil . validateMinMax ( this . value , this . minValue , this . maxValue ) ;
869+ if ( Object . keys ( errors ) . length === 0 ) {
870+ this . _calendar ?. daysView ?. focusActiveDate ( ) ;
871+ }
866872 } ) ;
867873
868874 this . _overlayService . onClosing . pipe ( ...this . _overlaySubFilter ) . subscribe ( ( eventArgs ) => {
@@ -904,6 +910,16 @@ export class IgxDatePickerComponent extends PickerBaseDirective implements Contr
904910 }
905911 }
906912
913+ private setRequired ( ) : void {
914+ // workaround for igxInput setting required
915+ Promise . resolve ( ) . then ( ( ) => {
916+ const isRequired = this . required ;
917+ if ( this . inputGroup && this . inputGroup . isRequired !== isRequired ) {
918+ this . inputGroup . isRequired = isRequired ;
919+ }
920+ } ) ;
921+ }
922+
907923 private _initializeCalendarContainer ( componentInstance : IgxCalendarContainerComponent ) {
908924 this . _calendar = componentInstance . calendar ;
909925 const isVertical = this . headerOrientation === PickerHeaderOrientation . Vertical ;
0 commit comments