-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix(pagination): add cdr check while page index change #6780
Conversation
This preview will be available after the AzureCI is passed. |
Codecov Report
@@ Coverage Diff @@
## master #6780 +/- ##
==========================================
- Coverage 89.70% 89.56% -0.15%
==========================================
Files 486 488 +2
Lines 15757 15778 +21
Branches 2564 2568 +4
==========================================
- Hits 14135 14131 -4
- Misses 980 1005 +25
Partials 642 642
Continue to review full report at Codecov.
|
@@ -132,6 +132,7 @@ export class NzPaginationComponent implements OnInit, OnDestroy, OnChanges { | |||
if (validIndex !== this.nzPageIndex && !this.nzDisabled) { | |||
this.nzPageIndex = validIndex; | |||
this.nzPageIndexChange.emit(this.nzPageIndex); | |||
this.cdr.markForCheck(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @PeterChen1997 感谢你的贡献,虽然这里的 markForCheck()
在这里没有其它副作用,但是我觉得在 L:150 行调用意图更明显一点。
Promise.resolve().then(() => {
this.onPageIndexChange(lastIndex);
this.cdr.markForCheck();
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Can't trigger page index change while the nzPageIndexChange is not set due to the Zone refresh strategy
Issue Number: 6661
#6661
What is the new behavior?
Trigger change after emit the output function
Does this PR introduce a breaking change?
Other information