fix: do not auto-add elements to locked frame (#9851)

* Do not return locked frames when filtering for top level frame

* lint

* lint

* lint
This commit is contained in:
zsviczian
2025-08-11 11:52:44 +02:00
committed by GitHub
parent 9036812b6d
commit cc8e490c75

View File

@@ -5708,8 +5708,9 @@ class App extends React.Component<AppProps, AppState> {
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;