Skip to content

Commit 80791db

Browse files
committed
fix(time-picker): increase pan event delta#9717
1 parent 0321b4f commit 80791db

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,15 @@ export class IgxItemListDirective implements OnInit {
178178
* @hidden @internal
179179
*/
180180
public ngOnInit() {
181-
const hammerOptions: HammerOptions = { recognizers: [[Hammer.Pan, { direction: Hammer.DIRECTION_VERTICAL, threshold: 5 }]] };
181+
const hammerOptions: HammerOptions = { recognizers: [[Hammer.Pan, { direction: Hammer.DIRECTION_VERTICAL, threshold: 20 }]] };
182182
this.touchManager.addEventListener(this.elementRef.nativeElement, 'pan', this.onPanMove, hammerOptions);
183183
}
184184

185185
private onPanMove = (event: HammerInput) => {
186-
const delta = event.deltaY < 0 ? -1 : 1;
187-
this.nextItem(delta);
186+
const delta = event.deltaY < -20 ? -1 : event.deltaY > 20 ? 1 : 0;
187+
if (event.deltaY % 20 === 0 && delta !== 0) {
188+
this.nextItem(delta);
189+
}
188190
};
189191

190192
private nextItem(delta: number): void {

0 commit comments

Comments
 (0)