fix: containerizing text incorrectly updates arrow bindings (#6369)

Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
Samyat Gautam 2023-03-18 11:00:28 -04:00 committed by GitHub
parent 7e330c8ee1
commit 0726911fa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 122 additions and 7 deletions

View file

@ -111,6 +111,9 @@ export class API {
fileId?: T extends "image" ? string : never;
scale?: T extends "image" ? ExcalidrawImageElement["scale"] : never;
status?: T extends "image" ? ExcalidrawImageElement["status"] : never;
startBinding?: T extends "arrow"
? ExcalidrawLinearElement["startBinding"]
: never;
endBinding?: T extends "arrow"
? ExcalidrawLinearElement["endBinding"]
: never;
@ -221,6 +224,10 @@ export class API {
});
break;
}
if (element.type === "arrow") {
element.startBinding = rest.startBinding ?? null;
element.endBinding = rest.endBinding ?? null;
}
if (id) {
element.id = id;
}