primeng
primeng copied to clipboard
Tree leaf is expandable in horizontal mode
I'm submitting a ...
[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Current behavior The tree component shows a expand/expanded icon but it is a leaf. There is a isLeaf() check missing like in the horizontal version.
Expected behavior Like in horizontal version or in showcase.
Code for horizontal version:
<span class="ui-tree-toggler fa fa-fw" [ngClass]="{'fa-plus':!node.expanded,'fa-minus':node.expanded}" *ngIf="!isLeaf()" (click)="toggle($event)"></span
I asume this could be like this in the vertical version (not tested):
<span class="ui-tree-toggler fa fa-fw" [ngClass]="{'fa-caret-right':!isLeaf() && !node.expanded,'fa-caret-down':!isLeaf() && node.expanded}" (click)="toggle($event)"></span>
In vertical mode, the icon is still rendered for alignment purposes, on showcase it is not displayed, maybe your custom css is overriding that. A plunkr will help to identify the issue.