Browse Source

fix(gui-v2): focus decimal cell on edit enabled

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3005/head
Pranav C 2 years ago
parent
commit
95de96b6b4
  1. 8
      packages/nc-gui-v2/components/cell/Decimal.vue
  2. 2
      packages/nc-gui-v2/components/smartsheet/Cell.vue

8
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<HTMLInputElement>()
const vModel = useVModel(props, 'modelValue', emits)
onMounted(() => {
root.value?.focus()
})
const focus = (el: HTMLInputElement) => el?.focus()
</script>
<template>
<input
v-if="editEnabled"
ref="root"
:ref="focus"
v-model="vModel"
class="outline-none pa-0 border-none w-full h-full prose-sm"
type="number"

2
packages/nc-gui-v2/components/smartsheet/Cell.vue

@ -102,7 +102,7 @@ const syncAndNavigate = (dir: NavigateDir) => {
<template>
<div
class="nc-cell"
class="nc-cell w-full-h-full"
@keydown.stop.left
@keydown.stop.right
@keydown.stop.up

Loading…
Cancel
Save