@@ -35,7 +35,7 @@ import { Subject, fromEvent, interval, animationFrameScheduler } from 'rxjs';
35
35
import { EditorProvider } from '../core/edit-provider' ;
36
36
import { IgxTimePickerBase , IGX_TIME_PICKER_COMPONENT } from './time-picker.common' ;
37
37
import { IgxOverlayService } from '../services/overlay/overlay' ;
38
- import { NoOpScrollStrategy } from '../services/overlay/scroll' ;
38
+ import { AbsoluteScrollStrategy } from '../services/overlay/scroll' ;
39
39
import { ConnectedPositioningStrategy } from '../services/overlay/position' ;
40
40
import { HorizontalAlignment , VerticalAlignment , PositionSettings , OverlaySettings } from '../services/overlay/utilities' ;
41
41
import { takeUntil , filter , throttle } from 'rxjs/operators' ;
@@ -338,6 +338,23 @@ export class IgxTimePickerComponent implements
338
338
@Input ( )
339
339
public outlet : IgxOverlayOutletDirective | ElementRef ;
340
340
341
+ /**
342
+ * An @Input property that allows you to modify overlay positioning, interaction and scroll behavior.
343
+ * ```typescript
344
+ * const settings: OverlaySettings = {
345
+ * closeOnOutsideClick: true,
346
+ * modal: false
347
+ * }
348
+ * ```
349
+ * ---
350
+ * ```html
351
+ * <igx-time-picker [overlaySettings]="settings"></igx-time-picker>
352
+ * ```
353
+ * @memberof IgxTimePickerComponent
354
+ */
355
+ @Input ( )
356
+ public overlaySettings : OverlaySettings ;
357
+
341
358
/**
342
359
* Emitted when selection is made. The event contains the selected value. Returns {`oldValue`: `Date`, `newValue`: `Date`}.
343
360
*```typescript
@@ -704,7 +721,7 @@ export class IgxTimePickerComponent implements
704
721
this . _dropDownOverlaySettings = {
705
722
modal : false ,
706
723
closeOnOutsideClick : true ,
707
- scrollStrategy : new NoOpScrollStrategy ( ) ,
724
+ scrollStrategy : new AbsoluteScrollStrategy ( ) ,
708
725
positionStrategy : new ConnectedPositioningStrategy ( this . _positionSettings )
709
726
} ;
710
727
@@ -1143,27 +1160,31 @@ export class IgxTimePickerComponent implements
1143
1160
* ```
1144
1161
*/
1145
1162
public openDialog ( timePicker : IgxTimePickerComponent = this ) : void {
1146
- if ( this . mode === InteractionMode . Dialog ) {
1163
+
1164
+ if ( this . collapsed ) {
1147
1165
this . collapsed = false ;
1148
- if ( this . outlet ) {
1149
- this . _dialogOverlaySettings . outlet = this . outlet ;
1166
+
1167
+ let settings ;
1168
+ if ( this . mode === InteractionMode . Dialog ) {
1169
+ settings = this . overlaySettings || this . _dialogOverlaySettings ;
1150
1170
}
1151
- this . _overlayId = this . overlayService . attach ( this . container , this . _dialogOverlaySettings ) ;
1152
- this . overlayService . show ( this . _overlayId ) ;
1153
- }
1154
1171
1155
- if ( this . mode === InteractionMode . DropDown ) {
1156
- if ( this . collapsed ) {
1157
- this . collapsed = false ;
1158
- if ( this . outlet ) {
1159
- this . _dropDownOverlaySettings . outlet = this . outlet ;
1172
+ if ( this . mode === InteractionMode . DropDown ) {
1173
+ settings = this . overlaySettings || this . _dropDownOverlaySettings ;
1174
+ if ( settings . positionStrategy && settings . positionStrategy . settings ) {
1175
+ settings . positionStrategy . settings . target = this . group . element . nativeElement ;
1160
1176
}
1161
- this . _dropDownOverlaySettings . positionStrategy . settings . target = this . group . element . nativeElement ;
1162
- this . _overlayId = this . overlayService . attach ( this . container , this . _dropDownOverlaySettings ) ;
1163
- this . overlayService . show ( this . _overlayId ) ;
1164
- } else {
1165
- this . _onDropDownClosed ( ) ;
1166
1177
}
1178
+
1179
+ if ( this . outlet ) {
1180
+ settings . outlet = this . outlet ;
1181
+ }
1182
+
1183
+ this . _overlayId = this . overlayService . attach ( this . container , settings ) ;
1184
+ this . overlayService . show ( this . _overlayId ) ;
1185
+
1186
+ } else if ( this . mode === InteractionMode . DropDown ) {
1187
+ this . _onDropDownClosed ( ) ;
1167
1188
}
1168
1189
1169
1190
if ( this . value ) {
0 commit comments