fix: Remove flushSync from alt-lasso and elbow dragging (#9734)

* Remove lasso flushSync

* Remove selectedLinearElement flushSync

* Early return
This commit is contained in:
Omar Brikaa
2025-07-24 00:39:16 +03:00
committed by GitHub
parent e5e07260c6
commit f38f381989

View File

@ -8095,8 +8095,6 @@ class App extends React.Component<AppProps, AppState> {
this.scene,
);
flushSync(() => {
if (this.state.selectedLinearElement) {
this.setState({
selectedLinearElement: {
...this.state.selectedLinearElement,
@ -8104,8 +8102,6 @@ class App extends React.Component<AppProps, AppState> {
pointerDownState: ret.pointerDownState,
},
});
}
});
return;
}
@ -8618,7 +8614,6 @@ class App extends React.Component<AppProps, AppState> {
pointerDownState.lastCoords.x = pointerCoords.x;
pointerDownState.lastCoords.y = pointerCoords.y;
if (event.altKey) {
flushSync(() => {
this.setActiveTool(
{ type: "lasso", fromSelection: true },
event.shiftKey,
@ -8631,10 +8626,9 @@ class App extends React.Component<AppProps, AppState> {
this.setAppState({
selectionElement: null,
});
});
} else {
this.maybeDragNewGenericElement(pointerDownState, event);
return;
}
this.maybeDragNewGenericElement(pointerDownState, event);
} else if (this.state.activeTool.type === "lasso") {
if (!event.altKey && this.state.activeTool.fromSelection) {
this.setActiveTool({ type: "selection" });