Skip to content

Commit 9a95535

Browse files
committed
refactor(time-picker): include platformUtil #6482
1 parent c397f18 commit 9a95535

File tree

2 files changed

+19
-26
lines changed

2 files changed

+19
-26
lines changed

projects/igniteui-angular/src/lib/tabs/tabs/tabs.component.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ export class IgxTabsComponent extends IgxTabsDirective {
106106

107107
/** @hidden */
108108
public realignSelectedIndicator() {
109-
if (this.selectedIndex >=0 && this.selectedIndex < this.items.length) {
110-
const header = this.items.get(this.selectedIndex).headerComponent.nativeElement;
111-
this.alignSelectedIndicator(header, 0);
112-
}
109+
// if (this.selectedIndex >=0 && this.selectedIndex < this.items.length) {
110+
// const header = this.items.get(this.selectedIndex).headerComponent.nativeElement;
111+
// this.alignSelectedIndicator(header, 0);
112+
// }
113113
}
114114

115115
/** @hidden */

projects/igniteui-angular/src/lib/time-picker/time-picker.component.ts

+15-22
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import { IgxDateTimeEditorModule, IgxDateTimeEditorDirective } from '../directiv
5252
import { IgxToggleModule, IgxToggleDirective } from '../directives/toggle/toggle.directive';
5353
import { ITimePickerResourceStrings } from '../core/i18n/time-picker-resources';
5454
import { CurrentResourceStrings } from '../core/i18n/resources';
55-
import { KEYS, IBaseEventArgs, isEqual, isDate } from '../core/utils';
55+
import { IBaseEventArgs, isEqual, isDate, PlatformUtil } from '../core/utils';
5656
import { PickerInteractionMode } from '../date-common/types';
5757
import { IgxTextSelectionModule } from '../directives/text-selection/text-selection.directive';
5858
import { 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

Comments
 (0)