'deactivate mat-step in angular when user clicks outside mat-stepper

I am working on an angular application where I am using vertical mat-stepper. On the same page I have another component to see some info. When user load the page for the first time he/she gets the default step selected on the UI. But when he clicks outside the mat-stepper, mat-stepper is still showing the step as Active which was selected by default on landing.

Is there any way in angular to deactivate the step when user has clicked outside?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source