diff --git a/package.json b/package.json index 796e4c8ac0f..209a9468ac9 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'", "test:unit": "cypress open-ct", "test:unit:ci": "cypress run-ct --quiet --reporter spec", - "ts:check": "vue-tsc --build --force", + "ts:check": "vue-tsc --noEmit -p ./tsconfig.app.json", "ts:generate": "vue-tsc --declaration --emitDeclarationOnly || true", "ts-docs:generate": "npx typedoc --skipErrorChecking", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix", diff --git a/src/fixtures/wizard/screen.vue b/src/fixtures/wizard/screen.vue index 46a6c141cf5..8ed656a6904 100644 --- a/src/fixtures/wizard/screen.vue +++ b/src/fixtures/wizard/screen.vue @@ -119,7 +119,7 @@ required: t('wizard.configure.name.error.required') }" ref="stepThreeStart" - @focusElement="focusStepThree" + @focusElement="focusFirst" :activeStep="step" :step="2" /> @@ -479,43 +479,20 @@ const refocusPanel = () => { const focusFirst = () => { switch (step.value) { case 0: - focusStepOne(); + focusOnStep(stepOneStart); break; case 1: - focusStepTwo(); + focusOnStep(stepTwoStart); break; case 2: - focusStepThree(); + focusOnStep(stepThreeStart); break; } }; -const focusStepOne = () => { - for (let inputRef in stepOneStart.value) { - if (stepOneStart.value[inputRef]) { - stepOneStart.value[inputRef].focus(); - break; - } - } -}; - -const focusStepTwo = () => { - for (let inputRef in stepTwoStart.value) { - if (stepTwoStart.value[inputRef]) { - stepTwoStart.value[inputRef].focus(); - break; - } - } -}; - -const focusStepThree = () => { - for (let inputRef in stepThreeStart.value) { - if (stepThreeStart.value[inputRef]) { - stepThreeStart.value[inputRef].focus(); - break; - } - } -}; +function focusOnStep(step: typeof stepOneStart) { + (step.value?.$el.querySelectorAll('input, select')[0] as HTMLElement)?.focus(); +} // reads uploaded file const uploadFile = async (file: File) => { @@ -849,7 +826,7 @@ const updateColour = (eventData: any) => { const cancelServiceStep = () => { goNext.value = false; wizardStore.goToStep(0); - focusStepOne(); + focusOnStep(stepOneStart); }; const cancelFormatStep = () => {