Explorar o código

(un)lock a frame should not affect elements unrelated to the frame

Ryan Di hai 1 ano
pai
achega
0bf1b4c4af
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      src/actions/actionElementLock.ts

+ 3 - 2
src/actions/actionElementLock.ts

@@ -28,8 +28,9 @@ export const actionToggleElementLock = register({
       elements: elements.map((element) => {
         if (
           !selectedElementsMap.has(element.id) &&
-          element.frameId &&
-          !selectedElementsMap.has(element.frameId)
+          (!element.frameId ||
+            // lock frame children if frame is selected
+            (element.frameId && !selectedElementsMap.has(element.frameId)))
         ) {
           return element;
         }