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;
|
||||
};
|
||||
|
||||
private handleCanvasPointerDown = (
|
||||
event: React.PointerEvent<HTMLCanvasElement>,
|
||||
) => {
|
||||
private handleCanvasPointerDown = withBatchedUpdates(
|
||||
(event: React.PointerEvent<HTMLCanvasElement>) => {
|
||||
event.persist();
|
||||
|
||||
if (this.state.openMenu === "canvas") {
|
||||
this.setState({ openMenu: null });
|
||||
}
|
||||
|
||||
// remove any active selection when we start to interact with canvas
|
||||
// (mainly, we care about removing selection outside the component which
|
||||
// would prevent our copy handling otherwise)
|
||||
@ -2388,7 +2391,8 @@ class App extends React.Component<AppProps, AppState> {
|
||||
pointerDownState.eventListeners.onKeyUp = onKeyUp;
|
||||
pointerDownState.eventListeners.onKeyDown = onKeyDown;
|
||||
}
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
private maybeOpenContextMenuAfterPointerDownOnTouchDevices = (
|
||||
event: React.PointerEvent<HTMLCanvasElement>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user