From 59f5b886ecd48b18ce2a7a7c49bdbaad5d2040fa Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 26 Apr 2023 13:37:04 +0800 Subject: [PATCH] fix(nc-gui): cellWrapperEl + provide IsExpandedFormOpenInj --- .../nc-gui/components/smartsheet/expanded-form/index.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/expanded-form/index.vue b/packages/nc-gui/components/smartsheet/expanded-form/index.vue index d1dc2d97f8..f03d3eb229 100644 --- a/packages/nc-gui/components/smartsheet/expanded-form/index.vue +++ b/packages/nc-gui/components/smartsheet/expanded-form/index.vue @@ -5,6 +5,7 @@ import type { Ref } from 'vue' import { CellClickHookInj, FieldsInj, + IsExpandedFormOpenInj, IsFormInj, IsKanbanInj, MetaInj, @@ -180,10 +181,14 @@ if (isKanban.value) { } } -const cellWrapperEl = ref() +provide(IsExpandedFormOpenInj, isExpanded) + +const cellWrapperEl = ref() onMounted(() => { - setTimeout(() => (cellWrapperEl.value?.querySelector('input,select,textarea') as HTMLInputElement)?.focus()) + setTimeout(() => { + cellWrapperEl.value?.$el?.querySelector('input,select,textarea')?.focus() + }, 300) }) const addNewRow = () => {