@@ -52,7 +52,7 @@ import { IgxDateTimeEditorModule, IgxDateTimeEditorDirective } from '../directiv
5252import { IgxToggleModule , IgxToggleDirective } from '../directives/toggle/toggle.directive' ;
5353import { ITimePickerResourceStrings } from '../core/i18n/time-picker-resources' ;
5454import { CurrentResourceStrings } from '../core/i18n/resources' ;
55- import { KEYS , IBaseEventArgs , isEqual , isDate } from '../core/utils' ;
55+ import { IBaseEventArgs , isEqual , isDate , PlatformUtil } from '../core/utils' ;
5656import { PickerInteractionMode } from '../date-common/types' ;
5757import { IgxTextSelectionModule } from '../directives/text-selection/text-selection.directive' ;
5858import { IgxLabelDirective } from '../directives/label/label.directive' ;
@@ -600,7 +600,8 @@ export class IgxTimePickerComponent extends PickerBaseDirective
600600 @Inject ( LOCALE_ID ) protected _localeId : string ,
601601 @Optional ( ) @Inject ( DisplayDensityToken ) protected _displayDensityOptions : IDisplayDensityOptions ,
602602 @Optional ( ) @Inject ( IGX_INPUT_GROUP_TYPE ) protected _inputGroupType : IgxInputGroupType ,
603- private _injector : Injector ) {
603+ private _injector : Injector ,
604+ private platform : PlatformUtil ) {
604605 super ( element , _localeId , _displayDensityOptions , _inputGroupType ) ;
605606 }
606607
@@ -818,8 +819,8 @@ export class IgxTimePickerComponent extends PickerBaseDirective
818819 * ```
819820 */
820821 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 ( ) ;
823824 }
824825
825826 /**
@@ -833,8 +834,8 @@ export class IgxTimePickerComponent extends PickerBaseDirective
833834 * ```
834835 */
835836 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 ( ) ;
838839 }
839840
840841 /** @hidden @internal */
@@ -1033,28 +1034,20 @@ export class IgxTimePickerComponent extends PickerBaseDirective
10331034 /** @hidden @internal */
10341035 public onKeyDown ( event : KeyboardEvent ) : void {
10351036 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 ( ) ;
10421040 }
10431041 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 ( ) ;
10501045 }
10511046 break ;
1052- case KEYS . ESCAPE :
1053- case KEYS . ESCAPE_IE :
1047+ case this . platform . KEYMAP . ESCAPE :
10541048 this . cancelButtonClick ( ) ;
10551049 break ;
1056- case KEYS . SPACE :
1057- case KEYS . SPACE_IE :
1050+ case this . platform . KEYMAP . SPACE :
10581051 this . open ( ) ;
10591052 event . preventDefault ( ) ;
10601053 break ;
0 commit comments