mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 05:11:55 +01:00
[Perf] Touch listeners should be passive
This commit is contained in:
parent
a76a7c3ac8
commit
18c88042e9
@ -64,7 +64,7 @@ export function captureEvents(element: HTMLElement, options: CaptureOptions) {
|
|||||||
// We need to always listen on `touchstart` target:
|
// We need to always listen on `touchstart` target:
|
||||||
// https://stackoverflow.com/questions/33298828/touch-move-event-dont-fire-after-touch-start-target-is-removed
|
// https://stackoverflow.com/questions/33298828/touch-move-event-dont-fire-after-touch-start-target-is-removed
|
||||||
const target = e.target as HTMLElement;
|
const target = e.target as HTMLElement;
|
||||||
target.addEventListener('touchmove', onMove);
|
target.addEventListener('touchmove', onMove, { passive: true });
|
||||||
target.addEventListener('touchend', onRelease);
|
target.addEventListener('touchend', onRelease);
|
||||||
target.addEventListener('touchcancel', onRelease);
|
target.addEventListener('touchcancel', onRelease);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user