Compare commits

...

1 Commits

Author SHA1 Message Date
dwelle
c96b0404ba feat: close mobile canvas menu on canvas pointerdown 2021-05-25 22:51:31 +02:00

View File

@ -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>,