fix: repair invalid binding on restore & fix type check (#8133)
This commit is contained in:
@@ -188,10 +188,8 @@ const getOriginalBindingIfStillCloseOfLinearElementEdge = (
|
||||
? linearElement.startBinding?.elementId
|
||||
: linearElement.endBinding?.elementId;
|
||||
if (elementId) {
|
||||
const element = elementsMap.get(
|
||||
elementId,
|
||||
) as NonDeleted<ExcalidrawBindableElement>;
|
||||
if (bindingBorderTest(element, coors, app)) {
|
||||
const element = elementsMap.get(elementId);
|
||||
if (isBindableElement(element) && bindingBorderTest(element, coors, app)) {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ export const isBindingElementType = (
|
||||
};
|
||||
|
||||
export const isBindableElement = (
|
||||
element: ExcalidrawElement | null,
|
||||
element: ExcalidrawElement | null | undefined,
|
||||
includeLocked = true,
|
||||
): element is ExcalidrawBindableElement => {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user