Fixes: https://tracker.ceph.com/issues/75434
Signed-off-by: Sagar Gopale <sagar.gopale@ibm.com>
}
onNext() {
- const formEl = document.querySelector('form');
- formEl?.dispatchEvent(new Event('submit', { bubbles: true }));
+ const currentForm = this.stepContents?.toArray()?.[this.currentStep]?.stepComponent?.formGroup;
+ currentForm?.markAllAsTouched();
+ currentForm?.updateValueAndValidity({ emitEvent: true });
+ if (currentForm) {
+ this._updateStepInvalid(this.currentStep, currentForm.invalid);
+ }
+
if (this.currentStep !== this.lastStep && !this.steps[this.currentStep].invalid) {
this.currentStep = this.currentStep + 1;
this.stepChanged.emit({ current: this.currentStep });