Skip to content

Commit

Permalink
fix(list): ensure list items are aligned vertically (#437)
Browse files Browse the repository at this point in the history
Fixes #436
  • Loading branch information
dlabrecq authored Aug 3, 2018
1 parent 1ad5101 commit 7a1904b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/app/list/basic-list/list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>
<!-- content -->
<div class="list-pf-content list-pf-content-flex">
<div class="pfng-list-content">
<div class="pfng-list-heading">
<ng-template *ngIf="itemHeadingTemplate"
[ngTemplateOutlet]="itemHeadingTemplate"
[ngTemplateOutletContext]="{ item: item, index: i }">
Expand Down Expand Up @@ -74,7 +74,7 @@
</div>
<!-- content -->
<div class="list-pf-content list-pf-content-flex">
<div class="pfng-list-content"
<div class="list-pf-content list-pf-content-flex"
(click)="toggleSelection($event, item)"
(dblclick)="dblClick($event, item)">
<ng-template *ngIf="itemTemplate"
Expand Down
4 changes: 2 additions & 2 deletions src/app/list/basic-list/list.component.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
width: 12px;
}

// Container for item click events
.pfng-list-content {
// Container for item heading
.pfng-list-heading {
display: flex;
flex-grow: 1;
}
Expand Down
9 changes: 6 additions & 3 deletions src/app/list/basic-list/list.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ describe('List component - ', () => {
});

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

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

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

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

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

expect(selectedItems.length).toBe(0);
Expand Down

0 comments on commit 7a1904b

Please sign in to comment.