Reset selection when adding text
This commit is contained in:
parent
ee7dc953bf
commit
afe6331c61
11
src/index.js
11
src/index.js
@ -257,7 +257,10 @@ class App extends React.Component {
|
|||||||
generateDraw(element);
|
generateDraw(element);
|
||||||
elements.push(element);
|
elements.push(element);
|
||||||
if (this.state.elementType === "text") {
|
if (this.state.elementType === "text") {
|
||||||
this.setState({ draggingElement: null });
|
this.setState({
|
||||||
|
draggingElement: null,
|
||||||
|
elementType: "selection"
|
||||||
|
});
|
||||||
element.isSelected = true;
|
element.isSelected = true;
|
||||||
} else {
|
} else {
|
||||||
this.setState({ draggingElement: element });
|
this.setState({ draggingElement: element });
|
||||||
@ -297,8 +300,10 @@ class App extends React.Component {
|
|||||||
} else {
|
} else {
|
||||||
draggingElement.isSelected = true;
|
draggingElement.isSelected = true;
|
||||||
}
|
}
|
||||||
this.setState({ draggingElement: null });
|
this.setState({
|
||||||
this.setState({ elementType: "selection" });
|
draggingElement: null,
|
||||||
|
elementType: "selection"
|
||||||
|
});
|
||||||
drawScene();
|
drawScene();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user