From 6761ee23bb5c4b1585e689b48233aa9e2a33a5c5 Mon Sep 17 00:00:00 2001 From: Stefan Isakovic <77689902+stefan-isakovic@users.noreply.github.com> Date: Wed, 23 Mar 2022 14:40:47 +0100 Subject: [PATCH] fix selection for flowbar component (#98) --- .../material-addons/src/lib/flowbar/flowbar.component.html | 2 +- .../material-addons/src/lib/flowbar/flowbar.component.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/material-addons/src/lib/flowbar/flowbar.component.html b/projects/material-addons/src/lib/flowbar/flowbar.component.html index 77364fb9..6fc5db06 100644 --- a/projects/material-addons/src/lib/flowbar/flowbar.component.html +++ b/projects/material-addons/src/lib/flowbar/flowbar.component.html @@ -1,5 +1,5 @@
- +
diff --git a/projects/material-addons/src/lib/flowbar/flowbar.component.ts b/projects/material-addons/src/lib/flowbar/flowbar.component.ts index 6e72b63b..bc4b675b 100644 --- a/projects/material-addons/src/lib/flowbar/flowbar.component.ts +++ b/projects/material-addons/src/lib/flowbar/flowbar.component.ts @@ -49,6 +49,11 @@ export class FlowbarComponent implements OnInit, AfterViewInit { this.stepper._getIndicatorType = () => 'number'; } + public getIndexForActiveStep(): number { + const selectedIndex = this._steps.indexOf(this._activeStep); + return selectedIndex === -1 ? 0 : selectedIndex; + } + public changeActiveStep(step: IStep): void { const previousIndex = this._steps.indexOf(this._activeStep); this._activeStep = step;