From 3be5038c14c28b91e7c96e9452647e25a336985b Mon Sep 17 00:00:00 2001 From: David Luzar Date: Mon, 7 Dec 2020 19:22:20 +0100 Subject: [PATCH] Revert "Remove native gesture "support" from iOS (#2457)" (#2483) This reverts commit 2b6d1470f936bfae113fc4765988b20e7db35bbb. --- src/components/App.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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(