ngx-bootstrap icon indicating copy to clipboard operation
ngx-bootstrap copied to clipboard

Pagination breaks when reducing totalItems and page change is triggered

Open philippkoelmel opened this issue 10 years ago • 3 comments

Reducing the totalItems and thus forcing the page to change causes this error message: ORIGINAL EXCEPTION: Expression has changed after it was checked. Previous value: ''. Current value: '[object Object],[object Object],[object Object],[object Object],[object Object]'

Tracked it down to this line: https://github.com/valor-software/ng2-bootstrap/blob/fa22c98c157240ef0ef7d37d29c12beb5efdd2e6/components/pagination/pagination.component.ts#L233

I couldn't figure out the details. But an easy workaround was to change this line https://github.com/valor-software/ng2-bootstrap/blob/fa22c98c157240ef0ef7d37d29c12beb5efdd2e6/components/pagination/pagination.component.ts#L127

from this.selectPage(this.page); to simply writing the value this.writeValue(this.page);

PS: See here for reference https://github.com/valor-software/ng2-table/issues/173

philippkoelmel avatar Aug 26 '16 14:08 philippkoelmel

the suggested change seems to break the consistency of page number.

PRR24 avatar Aug 29 '16 11:08 PRR24

i have the same issue.. any solution? @valorkin @philippkoelmel

rkusuma avatar Jun 19 '17 07:06 rkusuma

Works fine in [email protected] - https://plnkr.co/edit/Z1NjZjsSfwX5PCeKz85a?p=preview Closed as can't reproduce, will be reopened if we have sample to reproduce.

IlyaSurmay avatar Nov 10 '17 15:11 IlyaSurmay