Angular Material Stepper causes mat-formfield to validate for dynamic forms when returning to an older step

前端 未结 2 1043
被撕碎了的回忆
被撕碎了的回忆 2021-01-11 16:55

A problem is occurring with the angular materials mat-stepper when working with dynamic forms. For example I have a stepper with 3 steps each having there own f

2条回答
  •  悲&欢浪女
    2021-01-11 17:58

    Following on previous post I've found better implementation for stepChanged function:

      stepChanged(event: StepperSelectionEvent) {
        if (event.previouslySelectedIndex > event.selectedIndex) {
         event.previouslySelectedStep.interacted = false;
        }
      }
    

    This code will set interacted property only on steps which you go from to previous steps.

提交回复
热议问题