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

Commit 7a1904b

Browse files
authored
fix(list): ensure list items are aligned vertically (#437)
Fixes #436
1 parent 1ad5101 commit 7a1904b

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</div>
1616
<!-- content -->
1717
<div class="list-pf-content list-pf-content-flex">
18-
<div class="pfng-list-content">
18+
<div class="pfng-list-heading">
1919
<ng-template *ngIf="itemHeadingTemplate"
2020
[ngTemplateOutlet]="itemHeadingTemplate"
2121
[ngTemplateOutletContext]="{ item: item, index: i }">
@@ -74,7 +74,7 @@
7474
</div>
7575
<!-- content -->
7676
<div class="list-pf-content list-pf-content-flex">
77-
<div class="pfng-list-content"
77+
<div class="list-pf-content list-pf-content-flex"
7878
(click)="toggleSelection($event, item)"
7979
(dblclick)="dblClick($event, item)">
8080
<ng-template *ngIf="itemTemplate"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
width: 12px;
44
}
55

6-
// Container for item click events
7-
.pfng-list-content {
6+
// Container for item heading
7+
.pfng-list-heading {
88
display: flex;
99
flex-grow: 1;
1010
}

src/app/list/basic-list/list.component.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ describe('List component - ', () => {
117117
});
118118

119119
it('should add active class to clicked list item', function() {
120-
let listItems = fixture.debugElement.queryAll(By.css('.pfng-list-content'));
120+
let listItems = fixture.debugElement.queryAll(By.css(
121+
'.list-pf-content.list-pf-content-flex .list-pf-content.list-pf-content-flex'));
121122
let selectedItems = fixture.debugElement.queryAll(By.css('.active'));
122123

123124
expect(selectedItems.length).toBe(0);
@@ -135,7 +136,8 @@ describe('List component - ', () => {
135136
});
136137

137138
it('should manage selected items', function() {
138-
let listItems = fixture.debugElement.queryAll(By.css('.pfng-list-content'));
139+
let listItems = fixture.debugElement.queryAll(By.css(
140+
'.list-pf-content.list-pf-content-flex .list-pf-content.list-pf-content-flex'));
139141
let selectedItems = fixture.debugElement.queryAll(By.css('.active'));
140142

141143
// allow item selection
@@ -151,7 +153,8 @@ describe('List component - ', () => {
151153
});
152154

153155
it('should respect the multiSelect setting', function() {
154-
let listItems = fixture.debugElement.queryAll(By.css('.pfng-list-content'));
156+
let listItems = fixture.debugElement.queryAll(By.css(
157+
'.list-pf-content.list-pf-content-flex .list-pf-content.list-pf-content-flex'));
155158
let selectedItems = fixture.debugElement.queryAll(By.css('.active'));
156159

157160
expect(selectedItems.length).toBe(0);

0 commit comments

Comments
 (0)