Browse Source

fix(nc-gui): duration focus issue

pull/4205/head
Wing-Kam Wong 2 years ago
parent
commit
1d89c7c8d3
  1. 5
      packages/nc-gui/components/cell/Duration.vue

5
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,
@ -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