mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-14 17:54:47 +01:00
fix: multiple line editor bugs (#9760)
Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
@@ -5868,6 +5868,9 @@ class App extends React.Component<AppProps, AppState> {
|
||||
scenePointerY,
|
||||
this,
|
||||
);
|
||||
const linearElement = editingLinearElement
|
||||
? this.scene.getElement(editingLinearElement.elementId)
|
||||
: null;
|
||||
|
||||
if (
|
||||
editingLinearElement &&
|
||||
@@ -5882,16 +5885,17 @@ class App extends React.Component<AppProps, AppState> {
|
||||
});
|
||||
});
|
||||
}
|
||||
if (editingLinearElement?.lastUncommittedPoint != null) {
|
||||
if (
|
||||
editingLinearElement?.lastUncommittedPoint != null &&
|
||||
linearElement &&
|
||||
isBindingElementType(linearElement.type)
|
||||
) {
|
||||
this.maybeSuggestBindingAtCursor(
|
||||
scenePointer,
|
||||
editingLinearElement.elbowed,
|
||||
);
|
||||
} else {
|
||||
// causes stack overflow if not sync
|
||||
flushSync(() => {
|
||||
this.setState({ suggestedBindings: [] });
|
||||
});
|
||||
} else if (this.state.suggestedBindings.length) {
|
||||
this.setState({ suggestedBindings: [] });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6155,15 +6159,6 @@ class App extends React.Component<AppProps, AppState> {
|
||||
setCursor(this.interactiveCanvas, CURSOR_TYPE.AUTO);
|
||||
} else if (isOverScrollBar) {
|
||||
setCursor(this.interactiveCanvas, CURSOR_TYPE.AUTO);
|
||||
} else if (
|
||||
this.state.selectedLinearElement &&
|
||||
hitElement?.id === this.state.selectedLinearElement.elementId
|
||||
) {
|
||||
this.handleHoverSelectedLinearElement(
|
||||
this.state.selectedLinearElement,
|
||||
scenePointerX,
|
||||
scenePointerY,
|
||||
);
|
||||
} else if (
|
||||
// if using cmd/ctrl, we're not dragging
|
||||
!event[KEYS.CTRL_OR_CMD]
|
||||
@@ -6205,6 +6200,14 @@ class App extends React.Component<AppProps, AppState> {
|
||||
} else {
|
||||
setCursor(this.interactiveCanvas, CURSOR_TYPE.AUTO);
|
||||
}
|
||||
|
||||
if (this.state.selectedLinearElement) {
|
||||
this.handleHoverSelectedLinearElement(
|
||||
this.state.selectedLinearElement,
|
||||
scenePointerX,
|
||||
scenePointerY,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.state.openDialog?.name === "elementLinkSelector" && hitElement) {
|
||||
|
||||
Reference in New Issue
Block a user