@@ -52,7 +52,7 @@ import { IgxDateTimeEditorModule, IgxDateTimeEditorDirective } from '../directiv
52
52
import { IgxToggleModule , IgxToggleDirective } from '../directives/toggle/toggle.directive' ;
53
53
import { ITimePickerResourceStrings } from '../core/i18n/time-picker-resources' ;
54
54
import { CurrentResourceStrings } from '../core/i18n/resources' ;
55
- import { KEYS , IBaseEventArgs , isEqual , isDate } from '../core/utils' ;
55
+ import { IBaseEventArgs , isEqual , isDate , PlatformUtil } from '../core/utils' ;
56
56
import { PickerInteractionMode } from '../date-common/types' ;
57
57
import { IgxTextSelectionModule } from '../directives/text-selection/text-selection.directive' ;
58
58
import { IgxLabelDirective } from '../directives/label/label.directive' ;
@@ -600,7 +600,8 @@ export class IgxTimePickerComponent extends PickerBaseDirective
600
600
@Inject ( LOCALE_ID ) protected _localeId : string ,
601
601
@Optional ( ) @Inject ( DisplayDensityToken ) protected _displayDensityOptions : IDisplayDensityOptions ,
602
602
@Optional ( ) @Inject ( IGX_INPUT_GROUP_TYPE ) protected _inputGroupType : IgxInputGroupType ,
603
- private _injector : Injector ) {
603
+ private _injector : Injector ,
604
+ private platform : PlatformUtil ) {
604
605
super ( element , _localeId , _displayDensityOptions , _inputGroupType ) ;
605
606
}
606
607
@@ -818,8 +819,8 @@ export class IgxTimePickerComponent extends PickerBaseDirective
818
819
* ```
819
820
*/
820
821
public increment ( datePart ?: DatePart , delta ?: number ) : void {
821
- this . dateTimeEditor . increment ( datePart , delta ) ;
822
- this . setSelectedValue ( ) ;
822
+ this . dateTimeEditor . increment ( datePart , delta ) ;
823
+ this . setSelectedValue ( ) ;
823
824
}
824
825
825
826
/**
@@ -833,8 +834,8 @@ export class IgxTimePickerComponent extends PickerBaseDirective
833
834
* ```
834
835
*/
835
836
public decrement ( datePart ?: DatePart , delta ?: number ) : void {
836
- this . dateTimeEditor . decrement ( datePart , delta ) ;
837
- this . setSelectedValue ( ) ;
837
+ this . dateTimeEditor . decrement ( datePart , delta ) ;
838
+ this . setSelectedValue ( ) ;
838
839
}
839
840
840
841
/** @hidden @internal */
@@ -1033,28 +1034,20 @@ export class IgxTimePickerComponent extends PickerBaseDirective
1033
1034
/** @hidden @internal */
1034
1035
public onKeyDown ( event : KeyboardEvent ) : void {
1035
1036
switch ( event . key ) {
1036
- case KEYS . UP_ARROW :
1037
- case KEYS . UP_ARROW_IE :
1038
- if ( this . isDropdown ) {
1039
- if ( event . altKey ) {
1040
- this . close ( ) ;
1041
- }
1037
+ case this . platform . KEYMAP . ARROW_UP :
1038
+ if ( event . altKey && this . isDropdown ) {
1039
+ this . close ( ) ;
1042
1040
}
1043
1041
break ;
1044
- case KEYS . DOWN_ARROW :
1045
- case KEYS . DOWN_ARROW_IE :
1046
- if ( this . isDropdown ) {
1047
- if ( event . altKey ) {
1048
- this . open ( ) ;
1049
- }
1042
+ case this . platform . KEYMAP . ARROW_DOWN :
1043
+ if ( event . altKey && this . isDropdown ) {
1044
+ this . open ( ) ;
1050
1045
}
1051
1046
break ;
1052
- case KEYS . ESCAPE :
1053
- case KEYS . ESCAPE_IE :
1047
+ case this . platform . KEYMAP . ESCAPE :
1054
1048
this . cancelButtonClick ( ) ;
1055
1049
break ;
1056
- case KEYS . SPACE :
1057
- case KEYS . SPACE_IE :
1050
+ case this . platform . KEYMAP . SPACE :
1058
1051
this . open ( ) ;
1059
1052
event . preventDefault ( ) ;
1060
1053
break ;
0 commit comments