diff --git a/src/components/App.tsx b/src/components/App.tsx index 18b873e9..28dc6b76 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1407,14 +1407,30 @@ class App extends React.Component { private onGestureStart = withBatchedUpdates((event: GestureEvent) => { event.preventDefault(); + this.setState({ + selectedElementIds: {}, + }); + gesture.initialScale = this.state.zoom.value; }); private onGestureChange = withBatchedUpdates((event: GestureEvent) => { event.preventDefault(); + this.setState(({ zoom }) => ({ + zoom: getNewZoom( + getNormalizedZoom(gesture.initialScale! * event.scale), + zoom, + { x: cursorX, y: cursorY }, + ), + })); }); private onGestureEnd = withBatchedUpdates((event: GestureEvent) => { event.preventDefault(); + this.setState({ + previousSelectedElementIds: {}, + selectedElementIds: this.state.previousSelectedElementIds, + }); + gesture.initialScale = null; }); private handleTextWysiwyg(