diff --git a/src/core/components/navigation-bar/core-navigation-bar.html b/src/core/components/navigation-bar/core-navigation-bar.html index 1005bfcd5..24703b279 100644 --- a/src/core/components/navigation-bar/core-navigation-bar.html +++ b/src/core/components/navigation-bar/core-navigation-bar.html @@ -9,7 +9,7 @@ - + diff --git a/src/core/components/navigation-bar/navigation-bar.ts b/src/core/components/navigation-bar/navigation-bar.ts index c749dfa5f..2fb5af91f 100644 --- a/src/core/components/navigation-bar/navigation-bar.ts +++ b/src/core/components/navigation-bar/navigation-bar.ts @@ -67,15 +67,21 @@ export class CoreNavigationBarComponent implements OnChanges { this.progress = ((this.currentIndex + 1) / this.items.length) * 100; this.progressText = `${this.currentIndex + 1} / ${this.items.length}`; - this.nextIndex = this.items[this.currentIndex + 1]?.enabled ? this.currentIndex + 1 : -1; - if (this.nextIndex >= 0) { - this.nextTitle = Translate.instant(this.nextTranslate, { $a: this.items[this.nextIndex].title || '' }); + this.nextIndex =this.currentIndex + 1; + while (this.items[this.nextIndex] && !this.items[this.nextIndex].enabled) { + this.nextIndex++; } + this.nextTitle = this.items[this.nextIndex] + ? Translate.instant(this.nextTranslate, { $a: this.items[this.nextIndex].title || '' }) + : ''; - this.previousIndex = this.items[this.currentIndex - 1]?.enabled ? this.currentIndex - 1 : -1; - if (this.previousIndex >= 0) { - this.previousTitle = Translate.instant(this.previousTranslate, { $a: this.items[this.previousIndex].title || '' }); + this.previousIndex =this.currentIndex - 1; + while (this.items[this.previousIndex] && !this.items[this.previousIndex].enabled) { + this.previousIndex--; } + this.previousTitle = this.items[this.previousIndex] + ? Translate.instant(this.previousTranslate, { $a: this.items[this.previousIndex].title || '' }) + : ''; } /**