From cc8e490c7507cfa6810bae0be3fdc873e0317b3d Mon Sep 17 00:00:00 2001 From: zsviczian Date: Mon, 11 Aug 2025 11:52:44 +0200 Subject: [PATCH] fix: do not auto-add elements to locked frame (#9851) * Do not return locked frames when filtering for top level frame * lint * lint * lint --- packages/excalidraw/components/App.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index b381ad0f13..548df6f9d7 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -5708,8 +5708,9 @@ class App extends React.Component { const elementsMap = this.scene.getNonDeletedElementsMap(); const frames = this.scene .getNonDeletedFramesLikes() - .filter((frame): frame is ExcalidrawFrameLikeElement => - isCursorInFrame(sceneCoords, frame, elementsMap), + .filter( + (frame): frame is ExcalidrawFrameLikeElement => + !frame.locked && isCursorInFrame(sceneCoords, frame, elementsMap), ); return frames.length ? frames[frames.length - 1] : null;