components icon indicating copy to clipboard operation
components copied to clipboard

mat-errors that are tied to a custom ErrorStateMatcher aren't triggered when clicking next on mat-horizontal-stepper component

Open jamesworkdesk opened this issue 7 years ago • 2 comments

What are you trying to do?

Trying to make material stepper perform in linear mode when using controls that have custom validators. In my stackblitz posted below I have 3 controls in a mat step (step 1). I have a custom validation check on 'start date' and 'end date'. The custom validator checks to make sure start date does not exceed 'end date'. There is also a 'required' validator attached to 'end date'. When I click on the header to go to step 2 all the other controls show that they are empty except for 'end date'. I suppose I wanted to start troubleshooting at the most basic level. My initial question is: does 'linear' mode also trigger the display of errors when they are attached to a custom ErrorSateMatcher? In my real world app clicking on the 'next' button behaves the same way. In my stackblitz the 'next' button works for some reason.

What troubleshooting steps have you tried?

By default when clicking 'next' in the mat step component the controls are checked for validity and errors are displayed. However I have noticed that my custom controls do not display the errors even when the validity is checked.

Reproduction

https://stackblitz.com/edit/angular-cumv75?file=app/stepper-overview-example.html

Environment

  • Angular: @angular/[email protected]
  • CDK/Material: 6.4.7
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10]

jamesworkdesk avatar Sep 11 '19 17:09 jamesworkdesk

Sorry for the delay in providing help with this - we are currently limited on resources for troubleshooting issues. You will probably have better luck getting help if you post on StackOverflow.

andrewseguin avatar May 29 '20 20:05 andrewseguin

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.