From 4e0980bf55f9192b3709140170d3aac66c97040d Mon Sep 17 00:00:00 2001 From: Sander Elias Date: Sun, 5 Jan 2020 14:04:11 +0100 Subject: [PATCH] fix(scully-content.component): don't try to rerender content when nagigating one level "up" closes #121 --- .../ng-lib/src/lib/scully-content/scully-content.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/scullyio/ng-lib/src/lib/scully-content/scully-content.component.ts b/projects/scullyio/ng-lib/src/lib/scully-content/scully-content.component.ts index 4bba1d7c3..4aa7cfbdc 100644 --- a/projects/scullyio/ng-lib/src/lib/scully-content/scully-content.component.ts +++ b/projects/scullyio/ng-lib/src/lib/scully-content/scully-content.component.ts @@ -106,7 +106,8 @@ export class ScullyContentComponent implements OnInit, OnDestroy { ev.preventDefault(); this.router.navigate(splitRoute).catch(e => console.error('routing error', e)); - if (curSplit.every((part, i) => splitRoute[i] === part)) { + /** check for the same route with different "data", and NOT a level higher (length) */ + if (curSplit.every((part, i) => splitRoute[i] === part) && splitRoute.length > curSplit.length) { setTimeout(() => { const p = this.elm.parentElement; let cur = findComments(p, 'scullyContent-begin')[0] as HTMLElement;