fix: binding text to non-bindable containers and not always preferring selection (#4655)

This commit is contained in:
David Luzar 2022-03-02 17:04:09 +01:00 committed by GitHub
parent 8e26d5b500
commit 6d0716eb6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 336 additions and 85 deletions

View file

@ -8,6 +8,7 @@ import {
InitializedExcalidrawImageElement,
ExcalidrawImageElement,
ExcalidrawTextElementWithContainer,
ExcalidrawTextContainer,
} from "./types";
export const isGenericElement = (
@ -91,7 +92,9 @@ export const isBindableElement = (
);
};
export const isTextBindableContainer = (element: ExcalidrawElement | null) => {
export const isTextBindableContainer = (
element: ExcalidrawElement | null,
): element is ExcalidrawTextContainer => {
return (
element != null &&
(element.type === "rectangle" ||