angular material stepper: disable header navigation

后端 未结 11 973
再見小時候
再見小時候 2021-02-03 18:16

I want to navigate the stepper only through the next and back buttons.

I can\'t get this to work since users can also click each step label to navigate to any step. I c

11条回答
  •  生来不讨喜
    2021-02-03 19:13

    Just to improve on the accepted answer, as it will not work if you have a vertical stepper.

    To stop the user being able to click the header and navigate add the following code to you style.css file in the root:-

    .mat-step-header {
      pointer-events: none !important;
    }
    

    This will ensure it works for mat-horizontal-stepper-header and mat-vertical-stepper-header

提交回复
热议问题