DataTable - ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'NaNpx'. Current value: '352px' #3041
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ...
Current behavior
DataTable with lazy, scrollable and virtualScroll attributes causes the expression-changed in angular2 non-prod and more importantly in karma tests. Additional info: this happens when virtualTableHeight getter starts returning changing values in ScrollableView.html
<div #scrollTableWrapper style="position:relative" [ngStyle]="{'height':virtualTableHeight}">
.Expected behavior
Expression-changed shouldn't be thrown in non-prod and karma tests anymore.
Minimal reproduction of the problem with instructions
In this scenario karma tests already start failing if the dataTable isn't guarded by some ngIf basically preventing it from showing up altogether while testing.
For non-prod dev testing it is easily reproduced by introducing a checkbox with #someId and binding
[scrollable]="someId.checked"
, then hitting the checkbox (some data should be available I guess to allow for row height calculations inside of the DataTable code).What is the motivation / use case for changing the behavior?
DataTable with virtual lazy loading is extremely useful, but currently it causes problems due to the strict expression-changed testing in angular ^2.
Please tell us about your environment:
Windows 10 64, npm 5.0.3 + angular cli 1.1.0.
PrimeNG version: 4.0.3
Browser: Chrome
Language: TypeScript ~2.3.3
Node (for AoT issues):
node --version
= v6.10.3The text was updated successfully, but these errors were encountered: