diff --git a/packages/nc-gui-v2/components/dlg/TableCreate.vue b/packages/nc-gui-v2/components/dlg/TableCreate.vue index eb726c3a2e..864fa0ff5d 100644 --- a/packages/nc-gui-v2/components/dlg/TableCreate.vue +++ b/packages/nc-gui-v2/components/dlg/TableCreate.vue @@ -51,8 +51,10 @@ const validateDuplicate = (v: string) => { return (tables?.value || []).every((t) => t.table_name.toLowerCase() !== (v || '').toLowerCase()) || 'Duplicate table name' } -const inputEl = ref() +const inputEl = ref() + const useForm = Form.useForm + const validators = computed(() => { return { title: [validateTableName, validateDuplicateAlias], @@ -63,29 +65,18 @@ const { resetFields, validate, validateInfos } = useForm(table, validators) onMounted(() => { generateUniqueTitle() - - nextTick(() => { - const el = inputEl.value?.$el - el?.querySelector('input')?.focus() - el?.querySelector('input')?.select() - }) + inputEl.value?.focus() })