Skip to content

Commit

Permalink
Fix wizard ts errors and correct ts check command
Browse files Browse the repository at this point in the history
  • Loading branch information
milespetrov committed Dec 11, 2024
1 parent 89389c8 commit 69761e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
39 changes: 8 additions & 31 deletions src/fixtures/wizard/screen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
required: t('wizard.configure.name.error.required')
}"
ref="stepThreeStart"
@focusElement="focusStepThree"
@focusElement="focusFirst"
:activeStep="step"
:step="2"
/>
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -849,7 +826,7 @@ const updateColour = (eventData: any) => {
const cancelServiceStep = () => {
goNext.value = false;
wizardStore.goToStep(0);
focusStepOne();
focusOnStep(stepOneStart);
};
const cancelFormatStep = () => {
Expand Down

0 comments on commit 69761e8

Please sign in to comment.