From 3b997960730f4f5400a8571274b49b88bb2e4ae8 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Thu, 9 Sep 2021 00:35:10 +0200 Subject: [PATCH] fix(core): update --- ts_web/elements/dees-stepper.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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); }