From 2a87c7381b9dec5bb3f75f2667933705843644c9 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 26 Jan 2020 05:24:50 -0800 Subject: [PATCH] Set selection when unlocking (#567) A common workflow I have is to enable the lock, draw a bunch of things, unlock to be able to select stuff. However, after I unlock, the last shape is still enabled, so I end up drawing yet another of the same shape :( This PR resets to selection instead! --- src/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index baaf2ef36..5dca0ff37 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -496,7 +496,12 @@ export class App extends React.Component { return ( this.setState({ elementLocked: !elementLocked })} + onChange={() => { + this.setState({ + elementLocked: !elementLocked, + elementType: elementLocked ? "selection" : this.state.elementType, + }); + }} /> ); }