@@ -665,6 +665,7 @@ export class IgxDateRangePickerComponent extends PickerBaseDirective
665
665
public override ngAfterViewInit ( ) : void {
666
666
super . ngAfterViewInit ( ) ;
667
667
this . subscribeToDateEditorEvents ( ) ;
668
+ this . subscribeToClick ( ) ;
668
669
this . configPositionStrategy ( ) ;
669
670
this . configOverlaySettings ( ) ;
670
671
this . cacheFocusedInput ( ) ;
@@ -719,8 +720,8 @@ export class IgxDateRangePickerComponent extends PickerBaseDirective
719
720
}
720
721
721
722
/** @hidden @internal */
722
- public getEditElement ( ) {
723
- return this . inputDirective . nativeElement ;
723
+ public getEditElement ( ) : HTMLInputElement | undefined {
724
+ return this . inputDirective ? .nativeElement ;
724
725
}
725
726
726
727
protected onStatusChanged = ( ) => {
@@ -979,6 +980,20 @@ export class IgxDateRangePickerComponent extends PickerBaseDirective
979
980
return { start : range . start as Date , end : range . end as Date } ;
980
981
}
981
982
983
+ private subscribeToClick ( ) {
984
+ const editElement = this . getEditElement ( ) ;
985
+ if ( ! editElement ) {
986
+ return ;
987
+ }
988
+ fromEvent ( editElement , 'click' )
989
+ . pipe ( takeUntil ( this . _destroy$ ) )
990
+ . subscribe ( ( ) => {
991
+ if ( ! this . isDropdown ) {
992
+ this . toggle ( ) ;
993
+ }
994
+ } ) ;
995
+ }
996
+
982
997
private subscribeToDateEditorEvents ( ) : void {
983
998
if ( this . hasProjectedInputs ) {
984
999
const start = this . projectedInputs . find ( i => i instanceof IgxDateRangeStartComponent ) as IgxDateRangeStartComponent ;
0 commit comments