Browse Source

Merge pull request #5327 from nocodb/refactor/rename-view-click-outside

refactor(nc-gui): use VNodeRef for focusInput & blur to call onRename
pull/5329/head
Raju Udava 2 years ago committed by GitHub
parent
commit
b9bec7f178
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue

7
packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue

@ -1,4 +1,5 @@
<script lang="ts" setup>
import type { VNodeRef } from '@vue/runtime-core'
import type { KanbanType, ViewType, ViewTypes } from 'nocodb-sdk'
import type { WritableComputedRef } from '@vue/reactivity'
import { Tooltip } from 'ant-design-vue'
@ -93,9 +94,7 @@ onKeyStroke('Enter', (event) => {
}
})
function focusInput(el: HTMLInputElement) {
if (el) el.focus()
}
const focusInput: VNodeRef = (el) => (el as HTMLInputElement)?.focus()
/** Duplicate a view */
// todo: This is not really a duplication, maybe we need to implement a true duplication?
@ -183,7 +182,7 @@ function onStopEdit() {
v-if="isEditing"
:ref="focusInput"
v-model:value="vModel.title"
@blur="onCancel"
@blur="onRename"
@keydown.stop="onKeyDown($event)"
/>

Loading…
Cancel
Save