Skip to content

Commit a4c9a14

Browse files
jcorrea97bruno-severino
authored andcommitted
fix(treeview): corrige abertura dentro de um page-slide
Corrige comportamento de abertura do tree view dentro de um page slide. fixed: DTHFUI-8973
1 parent f4dc6da commit a4c9a14

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

projects/ui/src/lib/components/po-tree-view/po-tree-view-item/po-tree-view-item.component.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
>
1010
</po-tree-view-item-header>
1111

12-
<ul *ngIf="hasSubItems" class="po-tree-view-item-group" [@toggleBody]="item.expanded ? 'expanded' : 'collapsed'">
13-
<po-tree-view-item
14-
*ngFor="let subItem of item.subItems; trackBy: trackByFunction"
15-
[p-item]="subItem"
16-
[p-selectable]="selectable"
17-
[p-single-select]="singleSelect"
18-
[p-selected-value]="selectedValue"
19-
>
20-
</po-tree-view-item>
12+
<ul *ngIf="hasSubItems" class="po-tree-view-item-group">
13+
<div *ngIf="item.expanded" @toggleBody>
14+
<po-tree-view-item
15+
*ngFor="let subItem of item.subItems; trackBy: trackByFunction"
16+
[p-item]="subItem"
17+
[p-selectable]="selectable"
18+
[p-single-select]="singleSelect"
19+
[p-selected-value]="selectedValue"
20+
>
21+
</po-tree-view-item>
22+
</div>
2123
</ul>
2224
</li>

projects/ui/src/lib/components/po-tree-view/po-tree-view-item/po-tree-view-item.component.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,25 @@ import { PoTreeViewService } from '../services/po-tree-view.service';
1010
changeDetection: ChangeDetectionStrategy.OnPush,
1111
animations: [
1212
trigger('toggleBody', [
13-
state(
14-
'collapsed',
13+
transition(':enter', [
1514
style({
1615
'overflow-y': 'hidden',
1716
visibility: 'hidden',
1817
opacity: 0,
1918
height: '0'
20-
})
21-
),
22-
transition('expanded => collapsed', [
23-
style({ height: '*' }),
24-
animate(100, style({ opacity: 0 })),
25-
animate(200, style({ height: 0 }))
19+
}),
20+
animate(200, style({ height: '*' })),
21+
animate(100, style({ opacity: 1 }))
2622
]),
27-
transition('collapsed => expanded', [
28-
style({ height: '0' }),
29-
animate(100, style({ opacity: 1 })),
30-
animate(200, style({ height: '*' }))
23+
transition(':leave', [
24+
style({
25+
'overflow-y': 'hidden',
26+
visibility: 'visible',
27+
opacity: 1,
28+
height: '*'
29+
}),
30+
animate(200, style({ height: 0 })),
31+
animate(100, style({ opacity: 0 }))
3132
])
3233
])
3334
]

0 commit comments

Comments
 (0)