From 95de96b6b4363c8f3a70c442e03a03a3b4c18462 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 4 Aug 2022 22:28:50 +0530 Subject: [PATCH] fix(gui-v2): focus decimal cell on edit enabled Signed-off-by: Pranav C --- packages/nc-gui-v2/components/cell/Decimal.vue | 8 +++----- packages/nc-gui-v2/components/smartsheet/Cell.vue | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui-v2/components/cell/Decimal.vue b/packages/nc-gui-v2/components/cell/Decimal.vue index b2f15151a6..77b0a2f7a3 100644 --- a/packages/nc-gui-v2/components/cell/Decimal.vue +++ b/packages/nc-gui-v2/components/cell/Decimal.vue @@ -3,7 +3,7 @@ import { computed, inject, onMounted, ref } from '#imports' import { EditModeInj } from '~/context' interface Props { - modelValue: number | null + modelValue: number | null | string } interface Emits { @@ -20,15 +20,13 @@ const root = ref() const vModel = useVModel(props, 'modelValue', emits) -onMounted(() => { - root.value?.focus() -}) +const focus = (el: HTMLInputElement) => el?.focus()