Skip to content

Commit

Permalink
fix(progressbar): reorder 'value' and 'max' attribute bindings for IE
Browse files Browse the repository at this point in the history
Closes #543

Closes #544
  • Loading branch information
maxokorokov authored and pkozlowski-opensource committed Aug 4, 2016
1 parent 359b9b8 commit 30e20f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/progressbar/progressbar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@ describe('ng-progressbar', () => {

expect(getBarWidth(fixture.nativeElement)).toBe('10%');

// this might fail in IE11 if attribute binding order is not respected for the <progress> element:
// <progress [value]="" [max]=""> will fail with value = 1
// <progress [max]="" [value]=""> will work with value = 10
expect(getProgressbar(fixture.nativeElement).getAttribute('value')).toBe('10');

fixture.componentInstance.value = 30;
fixture.detectChanges();
expect(getBarWidth(fixture.nativeElement)).toBe('30%');
expect(getProgressbar(fixture.nativeElement).getAttribute('value')).toBe('30');
});
})));

Expand Down
2 changes: 1 addition & 1 deletion src/progressbar/progressbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {getValueInRange, toBoolean} from '../util/util';
<progress class="progress {{type ? 'progress-' + type : ''}}"
[class.progress-animated]="isAnimated()"
[class.progress-striped]="isStriped()"
[value]="getValue()" [max]="max">
[max]="max" [value]="getValue()">
<div class="progress">
<span class="progress-bar" [style.width.%]="getPercentValue()"><ng-content></ng-content></span>
</div>
Expand Down

0 comments on commit 30e20f5

Please sign in to comment.