Page 1 of 1

TriStateCheckbox ExpressionChangedAfterItHasBeenCheckedError for disabled binding

Posted: 23 Nov 2020, 22:23
by jrpereirajr
Hi there.

When I try to disable a TriStateCheckbox through a binding function, I got an ExpressionChangedAfterItHasBeenCheckedError.

The code for TriStateCheckbox is:

Code: Select all

<p-triStateCheckbox [(ngModel)]="value" label="status" [disabled]="disableWhenNull()"></p-triStateCheckbox>
When disableWhenNull() returns true, this message is issued in console:
ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ui-state-focus: true'. Current value: 'ui-state-focus: false'.
I simulated the issue here: https://stackblitz.com/edit/angular-pri ... onent.html
Test environment:
  • PrimeNG 6.1.7
  • Angular 6.0.4
  • Chrome 86.0.4240.193.
Could you help me to find what's wrong, please?

Thank you!
José