fix: False bind timeout indicator

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs
2025-09-22 18:22:35 +02:00
parent 83c7841bf1
commit 95f1c719c4

View File

@@ -1099,6 +1099,7 @@ class App extends React.Component<AppProps, AppState> {
isOverlapping = !!( isOverlapping = !!(
startBounds && startBounds &&
endBounds && endBounds &&
startElement.id !== endElement.id &&
doBoundsIntersect(startBounds, endBounds) doBoundsIntersect(startBounds, endBounds)
); );
} }
@@ -8517,10 +8518,12 @@ class App extends React.Component<AppProps, AppState> {
this.state, this.state,
{ newArrow: true }, { newArrow: true },
); );
this.handleDelayedBindModeChange(element, boundElement);
} }
// NOTE: We need the flushSync here for the
// delayed bind mode change to see the right state
// (specifically the `newElement`)
flushSync(() => {
this.setState((prevState) => { this.setState((prevState) => {
let linearElementEditor = null; let linearElementEditor = null;
let nextSelectedElementIds = prevState.selectedElementIds; let nextSelectedElementIds = prevState.selectedElementIds;
@@ -8559,6 +8562,11 @@ class App extends React.Component<AppProps, AppState> {
selectedLinearElement: linearElementEditor, selectedLinearElement: linearElementEditor,
}; };
}); });
});
if (isBindingElement(element)) {
this.handleDelayedBindModeChange(element, boundElement);
}
} }
}; };