diff --git a/packages/nc-gui/pages/index/index/[projectId].vue b/packages/nc-gui/pages/index/index/[projectId].vue index ede3bece09..188c89b6c9 100644 --- a/packages/nc-gui/pages/index/index/[projectId].vue +++ b/packages/nc-gui/pages/index/index/[projectId].vue @@ -5,21 +5,17 @@ import { extractSdkResponseErrorMsg, message, navigateTo, - nextTick, - onMounted, projectTitleValidator, reactive, ref, + tryOnMounted, useProject, useRoute, - useSidebar, } from '#imports' -useSidebar('nc-left-sidebar', { hasSidebar: false }) - const route = useRoute() -const { project, loadProject, updateProject, isLoading } = useProject() +const { project, loadProject, updateProject, isLoading, projectLoadedHook } = useProject() loadProject(false) @@ -48,18 +44,18 @@ const renameProject = async () => { } // select and focus title field on load -onMounted(async () => { +projectLoadedHook(async () => { formState.title = project.value.title as string - await nextTick(() => { + tryOnMounted(() => { // todo: replace setTimeout and follow better approach setTimeout(() => { const input = form.value?.$el?.querySelector('input[type=text]') - input.setSelectionRange(0, formState.title?.length) - input.focus() - }, 500) + + input.setSelectionRange(0, formState.title?.length) + }, 150) }) }) @@ -80,6 +76,7 @@ onMounted(async () => {

{{ $t('activity.editProject') }}

+