mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-12 11:59:58 +02:00
feat: close mobile canvas menu on canvas pointerdown
This commit is contained in:
@@ -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>,
|
||||
|
Reference in New Issue
Block a user