Browse Source

Merge pull request #4205 from nocodb/fix/duration

fix: duration issues
pull/4207/head
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
165731bac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/nc-gui/components/cell/Duration.vue

7
packages/nc-gui/components/cell/Duration.vue

@ -1,4 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { VNodeRef } from '@vue/runtime-core'
import { import {
ColumnInj, ColumnInj,
EditModeInj, EditModeInj,
@ -28,7 +29,7 @@ const durationInMS = ref(0)
const isEdited = ref(false) const isEdited = ref(false)
const durationType = ref(column?.value?.meta?.duration || 0) const durationType = computed(() => column?.value?.meta?.duration || 0)
const durationPlaceholder = computed(() => durationOptions[durationType.value].title) const durationPlaceholder = computed(() => durationOptions[durationType.value].title)
@ -67,13 +68,15 @@ const submitDuration = () => {
} }
isEdited.value = false isEdited.value = false
} }
const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus()
</script> </script>
<template> <template>
<div class="duration-cell-wrapper"> <div class="duration-cell-wrapper">
<input <input
v-if="editEnabled" v-if="editEnabled"
ref="durationInput" :ref="focus"
v-model="localState" v-model="localState"
class="w-full !border-none p-0" class="w-full !border-none p-0"
:class="{ '!px-2': editEnabled }" :class="{ '!px-2': editEnabled }"

Loading…
Cancel
Save