Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
michellewzhang committed May 16, 2024
1 parent 673d62a commit c92bc1b
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions packages/rrweb/src/replay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,27 +303,25 @@ export class Replayer {
pointerId,
{ pointerPosition, touchActive },
] of Object.entries(this.pointers)) {
if (touchActive === true) {
this.pointers[parseInt(pointerId)].pointerEl.classList.add(
'touch-active',
);
} else if (touchActive === false) {
this.pointers[parseInt(pointerId)].pointerEl.classList.remove(
'touch-active',
);
}
this.pointers[parseInt(pointerId)].touchActive = null;
const id = parseInt(pointerId);
if (pointerPosition) {
this.moveAndHover(
pointerPosition.x,
pointerPosition.y,
pointerPosition.id,
true,
pointerPosition.debugData,
parseInt(pointerId),
id,
);
this.pointers[parseInt(pointerId)].pointerPosition = null;
this.pointers[id].pointerPosition = null;
}

if (touchActive === true) {
this.pointers[id].pointerEl.classList.add('touch-active');
} else if (touchActive === false) {
this.pointers[id].pointerEl.classList.remove('touch-active');
}
this.pointers[id].touchActive = null;
}

if (this.lastMouseDownEvent) {
Expand Down Expand Up @@ -1218,9 +1216,6 @@ export class Replayer {
this.pointers[pointerId].touchActive = true;
} else if (d.type === MouseInteractions.TouchEnd) {
this.pointers[pointerId].touchActive = false;
this.pointers[pointerId].pointerEl.classList.remove(
'replayer-mouse',
);
}
if (d.type === MouseInteractions.MouseDown) {
this.lastMouseDownEvent = [target, event];
Expand Down Expand Up @@ -1260,9 +1255,6 @@ export class Replayer {
this.pointers[pointerId].pointerEl.classList.remove(
'touch-active',
);
this.pointers[pointerId].pointerEl.classList.remove(
'replayer-mouse',
);
} else {
// for MouseDown & MouseUp also invoke default behavior
target.dispatchEvent(event);
Expand Down

0 comments on commit c92bc1b

Please sign in to comment.