-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConfirmDialog - ExpressionChangedAfterItHasBeenCheckedError (when used with p-checkbox) #4982
Comments
Try with Angular 5.2.x please. |
Having the same issue on Angular 5.2.X using Primeng 5.2.0-rc.2 from input switch. Tried his plunker replacing 5.0.0 with 5.2.0 and got the same result. |
Updated Plunker to latest releases of Angular (5.2.3) and PrimeNG (5.2.0) and still getting the error |
Same error here. Important to note that it works fine with PrimeNG 5.0.2. Only 5.2 is now throwing these errors. |
@cagataycivici just wanted to point out that this issue (also noted in #5004) is completely blocking us from upgrading to 5.2. It's affecting virtually all of our Dialogs. |
Same problem here. As brian428 mentioned, the problem came with the upgrade to PrimeNG (5.2.0) and affects our Dialogs as well. |
Appears to be caused by #4686. |
This is probably angular issue angular/angular#6005 (comment) |
As I said in the other thread: I don't think so. Prod mode doesn't do the check for values changing while change detection is happening, but that doesn't mean it isn't happening. Just that the error isn't being thrown. The PrimeNG code needs to change to ensure that values aren't changing during change detection (which didn't start happening until PrimeNG 5.2). |
I still get this error. #5004 does not fix it. |
I've got a workaround/fix for this. You can monkey-patch the ConfirmDialog like the this: ConfirmDialog.prototype.ngAfterViewChecked = function () {
if (this.executePostShowActions) {
setTimeout(() => {
this.domHandler.findSingle(this.el.nativeElement.children[0], 'button').focus();
this.executePostShowActions = false;
}, 0);
}
} Just put this code into one of your TS files. |
Any update on this? I get this one a hotspot checkbox which crashes the whole application. |
I once got "ExpressionChangedAfterItHasBeenCheckedError" when firing p-confirmDialog on dropdown. What i did is to just add [ConfirmationService] as a provider to the component page where p-confirmDialog exists. This is supposed to be working if this is added to the app.module, but I guess due to complexity of code, the build wasn't able to detect that. |
I'm submitting a ...
Plunkr Case (Bug Reports)
http://plnkr.co/edit/w9xuZEmNzV5HM5fez8hs?p=preview
Current behavior
ExpressionChangedAfterItHasBeenCheckedError is thrown when confirm dialog is opened from p-checkbox event. Probably other components (dropdown, input switch) are affected as well - see #4139 for details/example.
Expected behavior
Showing the confirm dialog should not throw ExpressionChangedAfterItHasBeenCheckedError.
Minimal reproduction of the problem with instructions
In plunker above, toggle checkbox and take a look at the console.
What is the motivation / use case for changing the behavior?
Avoid ExpressionChangedAfterItHasBeenCheckedError.
Please tell us about your environment:
Windows 10
Angular version: 5.0.0
PrimeNG version: 5.0.2
Browser: Chrome 63
Language: TypeScript 2.6.2
The text was updated successfully, but these errors were encountered: