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!
This commit is contained in:
Christopher Chedeau 2020-01-26 05:24:50 -08:00 committed by David Luzar
parent ed42672fd3
commit 2a87c7381b
1 changed files with 6 additions and 1 deletions

View File

@ -496,7 +496,12 @@ export class App extends React.Component<any, AppState> {
return (
<LockIcon
checked={elementLocked}
onChange={() => this.setState({ elementLocked: !elementLocked })}
onChange={() => {
this.setState({
elementLocked: !elementLocked,
elementType: elementLocked ? "selection" : this.state.elementType,
});
}}
/>
);
}