fix: contextMenu timer & pointers not correctly reset on iOS (#4765)
This commit is contained in:
parent
0cdd0eebf1
commit
9653d676fe
@ -1315,11 +1315,14 @@ class App extends React.Component<AppProps, AppState> {
|
||||
};
|
||||
|
||||
private onTapEnd = (event: TouchEvent) => {
|
||||
this.resetContextMenuTimer();
|
||||
if (event.touches.length > 0) {
|
||||
this.setState({
|
||||
previousSelectedElementIds: {},
|
||||
selectedElementIds: this.state.previousSelectedElementIds,
|
||||
});
|
||||
} else {
|
||||
gesture.pointers.clear();
|
||||
}
|
||||
};
|
||||
|
||||
@ -1532,11 +1535,8 @@ class App extends React.Component<AppProps, AppState> {
|
||||
};
|
||||
|
||||
removePointer = (event: React.PointerEvent<HTMLElement> | PointerEvent) => {
|
||||
// remove touch handler for context menu on touch devices
|
||||
if (event.pointerType === "touch" && touchTimeout) {
|
||||
clearTimeout(touchTimeout);
|
||||
touchTimeout = 0;
|
||||
invalidateContextMenu = false;
|
||||
if (touchTimeout) {
|
||||
this.resetContextMenuTimer();
|
||||
}
|
||||
|
||||
gesture.pointers.delete(event.pointerId);
|
||||
@ -2937,6 +2937,12 @@ class App extends React.Component<AppProps, AppState> {
|
||||
}
|
||||
};
|
||||
|
||||
private resetContextMenuTimer = () => {
|
||||
clearTimeout(touchTimeout);
|
||||
touchTimeout = 0;
|
||||
invalidateContextMenu = false;
|
||||
};
|
||||
|
||||
private maybeCleanupAfterMissingPointerUp(
|
||||
event: React.PointerEvent<HTMLCanvasElement>,
|
||||
): void {
|
||||
|
Loading…
x
Reference in New Issue
Block a user