diff --git a/packages/nc-gui/components/smartsheet/Cell.vue b/packages/nc-gui/components/smartsheet/Cell.vue index 9061933bb0..48c01c80d0 100644 --- a/packages/nc-gui/components/smartsheet/Cell.vue +++ b/packages/nc-gui/components/smartsheet/Cell.vue @@ -76,6 +76,8 @@ provide(ReadonlyInj, readOnly) const isForm = inject(IsFormInj, ref(false)) +const isGrid = inject(IsGridInj, ref(false)) + const isPublic = inject(IsPublicInj, ref(false)) const isLocked = inject(IsLockedInj, ref(false)) @@ -124,14 +126,26 @@ const syncAndNavigate = (dir: NavigateDir, e: KeyboardEvent) => { if (!isForm.value) e.stopImmediatePropagation() } + +const isNumericField = computed(() => { + return ( + isInt(column.value, abstractType.value) || + isFloat(column.value, abstractType.value) || + isDecimal(column.value) || + isCurrency(column.value) || + isPercent(column.value) || + isDuration(column.value) + ) +}) + + diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 77804dc1c2..9171a9938b 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -284,7 +284,11 @@ const { activeCell.col = 0 makeEditable(data.value[activeCell.row], fields.value[activeCell.col]) nextTick(() => { - (document.querySelector('td.cell.active')?.querySelector('input,textarea') as HTMLInputElement | HTMLTextAreaElement)?.focus() + ;( + document.querySelector('td.cell.active')?.querySelector('input,textarea') as + | HTMLInputElement + | HTMLTextAreaElement + )?.focus() }) } break