Skip to content

Commit 97a90e2

Browse files
committed
fix(pickers): adding logic for date editor/picker, slowing scroll down further
1 parent 5317075 commit 97a90e2

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.directive.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
229229
@Output()
230230
public validationFailed = new EventEmitter<IgxDateTimeEditorEventArgs>();
231231

232+
233+
private readonly SCROLL_THRESHOLD = 50;
232234
private _inputFormat: string;
235+
private _scrollAccumulator = 0;
233236
private _displayFormat: string;
234237
private _oldValue: Date;
235238
private _dateValue: Date;
@@ -314,10 +317,14 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
314317
}
315318
event.preventDefault();
316319
event.stopPropagation();
317-
if (event.deltaY > 0) {
318-
this.decrement();
319-
} else {
320-
this.increment();
320+
this._scrollAccumulator += event.deltaY;
321+
if (Math.abs(this._scrollAccumulator) > this.SCROLL_THRESHOLD) {
322+
if (this._scrollAccumulator < 0) {
323+
this.decrement();
324+
} else {
325+
this.increment();
326+
}
327+
this._scrollAccumulator = 0;
321328
}
322329
}
323330

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class IgxItemListDirective implements OnInit, OnDestroy {
3434

3535
public isActive: boolean;
3636

37-
private readonly SCROLL_THRESHOLD = 15;
37+
private readonly SCROLL_THRESHOLD = 50;
3838
private readonly PAN_THRESHOLD = 10;
3939

4040
/**

0 commit comments

Comments
 (0)