Handle event undefined in initMoveObserver (#515)
This commit is contained in:
@@ -202,10 +202,12 @@ function initMouseInteractionObserver(
|
|||||||
if (isBlocked(event.target as Node, blockClass)) {
|
if (isBlocked(event.target as Node, blockClass)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const e = isTouchEvent(event) ? event.changedTouches[0] : event;
|
||||||
|
if (!e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const id = mirror.getId(event.target as INode);
|
const id = mirror.getId(event.target as INode);
|
||||||
const { clientX, clientY } = isTouchEvent(event)
|
const { clientX, clientY } = e;
|
||||||
? event.changedTouches[0]
|
|
||||||
: event;
|
|
||||||
cb({
|
cb({
|
||||||
type: MouseInteractions[eventKey],
|
type: MouseInteractions[eventKey],
|
||||||
id,
|
id,
|
||||||
|
|||||||
Reference in New Issue
Block a user