The type system was complaining about the remote possibility that e ended up as a TouchEvent instead of an individual Touch object I think
This commit is contained in:
@@ -238,11 +238,12 @@ function initMouseInteractionObserver({
|
||||
return;
|
||||
}
|
||||
let pointerType: PointerTypes | null = null;
|
||||
let e = event;
|
||||
if ('pointerType' in e) {
|
||||
if ('pointerType' in event) {
|
||||
Object.keys(PointerTypes).forEach(
|
||||
(pointerKey: keyof typeof PointerTypes) => {
|
||||
if ((e as PointerEvent).pointerType === pointerKey.toLowerCase()) {
|
||||
if (
|
||||
(event as PointerEvent).pointerType === pointerKey.toLowerCase()
|
||||
) {
|
||||
pointerType = PointerTypes[pointerKey];
|
||||
return;
|
||||
}
|
||||
@@ -262,7 +263,6 @@ function initMouseInteractionObserver({
|
||||
// TODO: these will get incorrectly emitted as MouseDown/MouseUp
|
||||
}
|
||||
} else if (legacy_isTouchEvent(event)) {
|
||||
e = event.changedTouches[0];
|
||||
pointerType = PointerTypes.Touch;
|
||||
}
|
||||
if (pointerType !== null) {
|
||||
@@ -271,6 +271,7 @@ function initMouseInteractionObserver({
|
||||
pointerType = currentPointerType;
|
||||
currentPointerType = null; // cleanup as we've used it
|
||||
}
|
||||
const e = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;
|
||||
if (!e) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user