ExpressionChangedAfterItHasBeenCheckedError
See original GitHub issue[x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior
It’s looks like it relates to other library, but it’s interferes with ngx-datatable
, at least I reproduced in that connection
When I show modal window from ng-bootstrap by handling (select)
output I get
ng:///NgxDatatableModule/DataTableBodyRowComponent.ngfactory.js:12 ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'datatable-body-cell sort-active active'. Current value: 'datatable-body-cell sort-active'.
it works fine when I show the same modal by (click)
on some button on the page, but it raise each time I do that by (select)
, and when it happens, next modal activate
break the page
Reproducing Fully reproduced with last angular and both packages here http://plnkr.co/edit/Ru8xoU3PNOqu4S1qUfbn?p=preview
Issue Analytics
- State:
- Created 6 years ago
- Reactions:23
- Comments:42 (3 by maintainers)
Top GitHub Comments
Same problem, resolved with blur…
I think this error is causing by the cell is deactive by popping up a modal, since it loses focus. The problem is the table component has been checked by angular and now it is changed by the modal. Therefore, it throws an error like
ExpressionChangedAfterItHasBeenCheckedError
.To prevent this error, I think the best way is preventing the cell become active or as soon as it becomes active, deactivate it.