feat: close mobile canvas menu on canvas pointerdown
This commit is contained in:
parent
790c9fd02e
commit
c96b0404ba
@ -2280,11 +2280,14 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
invalidateContextMenu = true;
|
invalidateContextMenu = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
private handleCanvasPointerDown = (
|
private handleCanvasPointerDown = withBatchedUpdates(
|
||||||
event: React.PointerEvent<HTMLCanvasElement>,
|
(event: React.PointerEvent<HTMLCanvasElement>) => {
|
||||||
) => {
|
|
||||||
event.persist();
|
event.persist();
|
||||||
|
|
||||||
|
if (this.state.openMenu === "canvas") {
|
||||||
|
this.setState({ openMenu: null });
|
||||||
|
}
|
||||||
|
|
||||||
// remove any active selection when we start to interact with canvas
|
// remove any active selection when we start to interact with canvas
|
||||||
// (mainly, we care about removing selection outside the component which
|
// (mainly, we care about removing selection outside the component which
|
||||||
// would prevent our copy handling otherwise)
|
// would prevent our copy handling otherwise)
|
||||||
@ -2388,7 +2391,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
pointerDownState.eventListeners.onKeyUp = onKeyUp;
|
pointerDownState.eventListeners.onKeyUp = onKeyUp;
|
||||||
pointerDownState.eventListeners.onKeyDown = onKeyDown;
|
pointerDownState.eventListeners.onKeyDown = onKeyDown;
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
);
|
||||||
|
|
||||||
private maybeOpenContextMenuAfterPointerDownOnTouchDevices = (
|
private maybeOpenContextMenuAfterPointerDownOnTouchDevices = (
|
||||||
event: React.PointerEvent<HTMLCanvasElement>,
|
event: React.PointerEvent<HTMLCanvasElement>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user