From f4c5de3d2b6ee3558981c104d247a2c8a2704135 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 29 Dec 2022 13:53:20 +0100 Subject: [PATCH] fix app anchors --- frontend/src/lib/components/apps/editor/GridEditor.svelte | 5 ++++- frontend/src/lib/components/apps/gridUtils.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/apps/editor/GridEditor.svelte b/frontend/src/lib/components/apps/editor/GridEditor.svelte index 2821f93ed4..03d76cf6f9 100644 --- a/frontend/src/lib/components/apps/editor/GridEditor.svelte +++ b/frontend/src/lib/components/apps/editor/GridEditor.svelte @@ -131,7 +131,10 @@ locked={isFixed(gridComponent)} on:delete={() => removeGridElement(gridComponent.data)} on:lock={() => { - gridComponent = toggleFixed(gridComponent) + let fComponent = $app.grid.find((c) => c.id === gridComponent.id) + if (fComponent) { + fComponent = toggleFixed(fComponent) + } }} /> diff --git a/frontend/src/lib/components/apps/gridUtils.ts b/frontend/src/lib/components/apps/gridUtils.ts index 01c0536306..a707570159 100644 --- a/frontend/src/lib/components/apps/gridUtils.ts +++ b/frontend/src/lib/components/apps/gridUtils.ts @@ -23,8 +23,9 @@ function disableDrag(component: GridItem): GridItem { } function toggleFixed(component: GridItem): GridItem { + const nValue = !component[gridColumns[0]].fixed gridColumns.forEach((column: number) => { - component[column].fixed = !component[column].fixed + component[column].fixed = nValue }) return component