mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-11 11:30:07 +02:00
fix: Deleted arrow causes problems
This commit is contained in:
@@ -898,7 +898,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
arrow: ExcalidrawArrowElement,
|
arrow: ExcalidrawArrowElement,
|
||||||
hoveredElement: NonDeletedExcalidrawElement | null,
|
hoveredElement: NonDeletedExcalidrawElement | null,
|
||||||
) {
|
) {
|
||||||
if (isElbowArrow(arrow)) {
|
if (arrow.isDeleted || isElbowArrow(arrow)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -913,7 +913,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
if (!this.state.multiElement) {
|
if (!this.state.multiElement) {
|
||||||
invariant(
|
invariant(
|
||||||
this.state.selectedLinearElement?.selectedPointsIndices?.length,
|
this.state.selectedLinearElement?.selectedPointsIndices?.length,
|
||||||
"There has to be at least one selected point to trigger bind mode change at arrow drag creation",
|
"There has to be at least one selected point to trigger bind mode change at arrow point drag",
|
||||||
);
|
);
|
||||||
|
|
||||||
const startDragged =
|
const startDragged =
|
||||||
@@ -8708,6 +8708,10 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
elementsMap,
|
elementsMap,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (element?.isDeleted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isBindingElement(element)) {
|
if (isBindingElement(element)) {
|
||||||
const hoveredElement = getHoveredElementForBinding(
|
const hoveredElement = getHoveredElementForBinding(
|
||||||
pointFrom<GlobalPoint>(pointerCoords.x, pointerCoords.y),
|
pointFrom<GlobalPoint>(pointerCoords.x, pointerCoords.y),
|
||||||
@@ -9195,7 +9199,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
newElement,
|
newElement,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (isLinearElement(newElement)) {
|
} else if (isLinearElement(newElement) && !newElement.isDeleted) {
|
||||||
pointerDownState.drag.hasOccurred = true;
|
pointerDownState.drag.hasOccurred = true;
|
||||||
const points = newElement.points;
|
const points = newElement.points;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user