Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit c57b70e

Browse files
committed
fix(list): pin sort should be based on boolean values
In order to ensure pins are sorted properly, all list items must have a showPin boolean value. Testing showPin=false Vs showPin=undefined does not result in the same sort order.
1 parent c4dce36 commit c57b70e

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/app/list/basic-list/examples/list-pin-example.component.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export class ListPinExampleComponent implements OnInit {
3838
clusterCount: 6,
3939
hostCount: 8,
4040
imageCount: 8,
41-
nodeCount: 10
41+
nodeCount: 10,
42+
showPin: false
4243
}, {
4344
name: 'John Smith',
4445
address: '415 East Main Street',
@@ -60,7 +61,8 @@ export class ListPinExampleComponent implements OnInit {
6061
hostCount: 8,
6162
clusterCount: 6,
6263
nodeCount: 10,
63-
imageCount: 8
64+
imageCount: 8,
65+
showPin: false
6466
}, {
6567
name: 'Linda McGovern',
6668
address: '22 Oak Street',
@@ -81,7 +83,8 @@ export class ListPinExampleComponent implements OnInit {
8183
hostCount: 8,
8284
clusterCount: 6,
8385
nodeCount: 10,
84-
imageCount: 8
86+
imageCount: 8,
87+
showPin: false
8588
}, {
8689
name: 'Holly Nichols',
8790
address: '21 Jump Street',
@@ -102,7 +105,8 @@ export class ListPinExampleComponent implements OnInit {
102105
hostCount: 8,
103106
clusterCount: 6,
104107
nodeCount: 10,
105-
imageCount: 8
108+
imageCount: 8,
109+
showPin: false
106110
}, {
107111
name: 'Pat Thomas',
108112
address: '50 Second Street',
@@ -112,7 +116,8 @@ export class ListPinExampleComponent implements OnInit {
112116
hostCount: 8,
113117
clusterCount: 6,
114118
nodeCount: 10,
115-
imageCount: 8
119+
imageCount: 8,
120+
showPin: false
116121
}];
117122
this.items = cloneDeep(this.allItems);
118123

src/app/list/basic-list/list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<!-- items -->
3535
<div class="list-pf-item {{item?.itemStyleClass}}"
3636
[ngClass]="{'active': item.selected || item.isItemExpanded}"
37-
*ngFor="let item of (config.usePinItems ? (items | sortArray: 'showPin') : items); let i = index">
37+
*ngFor="let item of (config.usePinItems ? (items | sortArray: 'showPin': true) : items); let i = index">
3838
<div class="list-pf-container">
3939
<!-- pin -->
4040
<div class="pfng-list-pin-container" *ngIf="config.usePinItems">

0 commit comments

Comments
 (0)