fix: frame selection and membership (#11250)

fix: element fully overlapping frame
This commit is contained in:
David Luzar
2026-04-28 18:23:10 +02:00
committed by GitHub
parent 2e1a529c67
commit 43fa4b5602
4 changed files with 76 additions and 8 deletions
+4 -2
View File
@@ -19,6 +19,7 @@ import {
getElementAbsoluteCoords,
doBoundsIntersect,
getElementBounds,
boundsContainBounds,
} from "./bounds";
import { mutateElement } from "./mutateElement";
import { getBoundTextElement, getContainerElement } from "./textElement";
@@ -101,8 +102,9 @@ export const isElementContainingFrame = (
frame: ExcalidrawFrameLikeElement,
elementsMap: ElementsMap,
) => {
return getElementsWithinSelection([frame], element, elementsMap).some(
(e) => e.id === frame.id,
return boundsContainBounds(
getElementBounds(element, elementsMap),
getElementBounds(frame, elementsMap),
);
};