diff --git a/packages/nc-gui-v2/components/dashboard/TabView.vue b/packages/nc-gui-v2/components/dashboard/TabView.vue index a16f179877..058e9e6067 100644 --- a/packages/nc-gui-v2/components/dashboard/TabView.vue +++ b/packages/nc-gui-v2/components/dashboard/TabView.vue @@ -15,7 +15,7 @@ const tableCreateDialog = ref(false) - + diff --git a/packages/nc-gui-v2/components/dlg/TableCreate.vue b/packages/nc-gui-v2/components/dlg/TableCreate.vue index b3a7aeadc2..eaca0a960b 100644 --- a/packages/nc-gui-v2/components/dlg/TableCreate.vue +++ b/packages/nc-gui-v2/components/dlg/TableCreate.vue @@ -3,7 +3,7 @@ import { onMounted } from '@vue/runtime-core' import useTableCreate from '../../composables/useTableCreate' import { validateTableName } from '~/utils/validation' -const { modelValue } = defineProps<{ modelValue?: boolean }>() +const { modelValue = false } = defineProps<{ modelValue?: boolean }>() const emit = defineEmits(['update:modelValue']) @@ -22,6 +22,7 @@ const dialogShow = computed({ }) const valid = ref(false) +const isIdToggleAllowed = ref(false) const isAdvanceOptVisible = ref(false) const { table, createTable, generateUniqueTitle, tables, project } = useTableCreate() @@ -37,10 +38,15 @@ const validateDuplicate = (v: string) => { return (tables?.value || []).every((t) => t.table_name.toLowerCase() !== (v || '').toLowerCase()) || 'Duplicate table name' } -const inputEl = ref() +const inputEl = ref() onMounted(() => { generateUniqueTitle() + nextTick(() => { + const el = inputEl?.value?.$el + el?.querySelector('input')?.focus() + el?.querySelector('input')?.select() + }) }) @@ -62,7 +68,7 @@ onMounted(() => {