fix(core): update

This commit is contained in:
Philipp Kunz 2021-09-10 15:51:30 +02:00
parent 8d1451fffa
commit 1f3502685f

View File

@ -15,6 +15,7 @@ export interface IStep {
title: string;
content: TemplateResult;
validationFunc?: (stepper: DeesStepper, htmlElement: HTMLElement) => Promise<any>;
onReturnToStepFunc?: (stepper: DeesStepper, htmlElement: HTMLElement) => Promise<any>;
validationFuncCalled?: boolean;
}
@ -209,9 +210,12 @@ export class DeesStepper extends DeesElement {
this.scroller.to(scrollPosition);
}
public goBack() {
public async goBack() {
const currentIndex = this.steps.findIndex(stepArg => stepArg === this.selectedStep);
this.selectedStep = this.steps[currentIndex - 1];
await this.domtoolsPromise;
await this.domtools.convenience.smartdelay.delayFor(100);
this.selectedStep.onReturnToStepFunc?.(this, this.shadowRoot.querySelector('.selected'));
}
public goNext() {