@@ -18,7 +18,7 @@ import {
18
18
AfterViewInit ,
19
19
Injector ,
20
20
PipeTransform ,
21
- LOCALE_ID , Optional , ContentChildren , QueryList , OnChanges , SimpleChanges
21
+ LOCALE_ID , Optional , ContentChildren , QueryList , OnChanges , SimpleChanges , HostListener
22
22
} from '@angular/core' ;
23
23
import {
24
24
ControlValueAccessor ,
@@ -690,7 +690,6 @@ export class IgxTimePickerComponent extends PickerBaseDirective
690
690
691
691
/** @hidden */
692
692
public ngAfterViewInit ( ) : void {
693
- this . attachOnKeydown ( ) ;
694
693
this . subscribeToDateEditorEvents ( ) ;
695
694
this . subscribeToToggleDirectiveEvents ( ) ;
696
695
if ( this . _ngControl ) {
@@ -1038,6 +1037,7 @@ export class IgxTimePickerComponent extends PickerBaseDirective
1038
1037
}
1039
1038
1040
1039
/** @hidden @internal */
1040
+ @HostListener ( 'keydown' , [ '$event' ] )
1041
1041
public onKeyDown ( event : KeyboardEvent ) : void {
1042
1042
switch ( event . key ) {
1043
1043
case this . platform . KEYMAP . ARROW_UP :
@@ -1432,12 +1432,6 @@ export class IgxTimePickerComponent extends PickerBaseDirective
1432
1432
}
1433
1433
}
1434
1434
1435
- private attachOnKeydown ( ) : void {
1436
- fromEvent ( this . getEditElement ( ) , 'keydown' )
1437
- . pipe ( takeUntil ( this . _destroy$ ) )
1438
- . subscribe ( ( evt : KeyboardEvent ) => this . onKeyDown ( evt ) ) ;
1439
- }
1440
-
1441
1435
private subscribeToDateEditorEvents ( ) : void {
1442
1436
this . dateTimeEditor . valueChange . pipe (
1443
1437
takeUntil ( this . _destroy$ ) ) . subscribe ( date => {
0 commit comments