From a18376ff87a550907a715ab07cadad28a5a61ee1 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 25 Aug 2022 19:53:31 +0530 Subject: [PATCH] fix(gui-v2): load column to field on clicking hidden columns list Signed-off-by: Pranav C --- packages/nc-gui-v2/components/smartsheet/Form.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/Form.vue b/packages/nc-gui-v2/components/smartsheet/Form.vue index 32aa41bed1..69cd029852 100644 --- a/packages/nc-gui-v2/components/smartsheet/Form.vue +++ b/packages/nc-gui-v2/components/smartsheet/Form.vue @@ -340,11 +340,16 @@ watch(submitted, (v) => { } }) -function handleMouseUp(col: Record) { +function handleMouseUp(col: Record, hiddenColIndex: number) { if (!moved.value) { const index = localColumns.value.length col.order = (index ? localColumns.value[index - 1].order : 0) + 1 col.show = true + + /** remove column from hiddenColumns and add to localColumns */ + localColumns.value.push(col) + hiddenColumns.value.splice(hiddenColIndex, 1) + saveOrUpdate(col, index) } } @@ -421,13 +426,13 @@ onMounted(async () => { @start="drag = true" @end="drag = false" > -