Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/example/cli5/clean…
Browse files Browse the repository at this point in the history
…-css-4.1.11
  • Loading branch information
adamkleingit committed Dec 19, 2019
2 parents b417523 + c1e4124 commit 2ef8f43
Show file tree
Hide file tree
Showing 6 changed files with 355 additions and 1,199 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,15 @@
<a name="8.5.2"></a>
# 8.5.2 (2019-03-12)
* Fixed computed value after updating model, because parent was null and we got a race-condition

<a name="8.5.1"></a>
# 8.5.1 (2019-07-11)
* Changed options input to ITreeOptions

<a name="8.5.0"></a>
# 8.5.0 (2019-06-11)
* Support IVY by removing transitive dependency on Renderer via mobx-angular

<a name="8.4.1"></a>
# 8.4.1 (2019-01-10)
* Exporting TreeNodeWrapperComponent and TreeAnimateOpenDirective from main module
Expand Down
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,13 @@

# angular tree component

<p align="center">
<a href="https://app.codefund.io/properties/628/visit-sponsor">
<img src="https://app.codefund.io/properties/628/sponsor" />
</a>
</p>


## ❤️ Support Us ❤️

Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/angular-tree-component/contribute)]
Expand Down
5 changes: 4 additions & 1 deletion lib/components/tree-node-collection.component.ts
Expand Up @@ -39,7 +39,10 @@ export class TreeNodeCollectionComponent implements OnInit, OnDestroy {

@computed get marginTop(): string {
const firstNode = this.viewportNodes && this.viewportNodes.length && this.viewportNodes[0];
const relativePosition = firstNode ? firstNode.position - firstNode.parent.position - firstNode.parent.getSelfHeight() : 0;
const relativePosition =
(firstNode && firstNode.parent)
? firstNode.position - firstNode.parent.position - firstNode.parent.getSelfHeight()
: 0;

return `${relativePosition}px`;
}
Expand Down

0 comments on commit 2ef8f43

Please sign in to comment.