Search code examples
angularmat-stepper

Angular matStepperNext calls unwanted submit method


Im using stepper on Angular 11

I want to use 3+ steppers to fill UserData form and evry time i press the next button it tries to submit , causing errors and triggering an allert beacouse the form is not completelly filled yet

I made a button save to submit data and it's clickable only at the end when the form is valid, but this next is ruining my plans

This is the next button, not much to see there, just the default one

<button mat-button matStepperPrevious>Back</button>

How can i keep using next button to go from step to step without submitting the form evrytime?

Or how can i make another button that goes to the next step without submitting?


Solution

  • You can add type to button type="button"