diff --git a/ts_web/elements/dees-stepper.ts b/ts_web/elements/dees-stepper.ts index 7c9de61..a2795c1 100644 --- a/ts_web/elements/dees-stepper.ts +++ b/ts_web/elements/dees-stepper.ts @@ -14,6 +14,8 @@ import * as domtools from '@designestate/dees-domtools'; export interface IStep { title: string; content: TemplateResult; + validationFunc?: (stepper: DeesStepper, htmlElement: HTMLElement) => Promise; + validationFuncCalled?: boolean; } declare global { @@ -200,6 +202,10 @@ export class DeesStepper extends DeesElement { easing: 'easeInOutQuint' }, stepperContainer); } + if (!this.selectedStep.validationFuncCalled && this.selectedStep.validationFunc) { + this.selectedStep.validationFuncCalled = true; + await this.selectedStep.validationFunc(this, selectedStepElement); + } this.scroller.to(scrollPosition); }