Skip to content
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

transfer控件不使用nzSelectChange的时候checkbox没有正常联动 #996

Closed
create-share opened this issue Jan 30, 2018 · 9 comments
Closed
Assignees
Labels

Comments

@create-share
Copy link
Contributor

Version

0.6.13

Environment

Mac / Chrome 63

Reproduction link

https://stackblitz.com/edit/angular-xhkjof?file=app%2Fnz-demo-transfer-basic.component.ts

Steps to reproduce

选择所有 target 列表的 checkbox,target 的全选没有选中,取消掉一个之后,全选选中了
transfer-bug

What is expected?

checkbox 正常联动

What is actually happening?

选择所有 target 列表的 checkbox,target 的全选没有选中,取消掉一个之后,全选选中了

Other?

这像是 Angular Form 模块 的一个 bug,在父组件使用 onPush 策略之后,自定义表单控件的子组件 writeValue 已经获取到最新的值,但是没有进行脏检查。
angular/angular#21780

@ng-zorro-bot
Copy link
Collaborator

It will be better to write your issue/comment in English, so more people can understand you.
And this means that more people can help you or benefit from your issue/comment.

@cipchk cipchk self-assigned this Jan 30, 2018
@cipchk
Copy link
Member

cipchk commented Jan 30, 2018

可能是逻辑上处理有问题,我不太确定,我会核实一下,可能不是 Angular 的问题。

@cipchk
Copy link
Member

cipchk commented Jan 31, 2018

的确非常奇怪,我可以排除逻辑上的问题;暂时先跟踪 Angular #21780。

@create-share
Copy link
Contributor Author

可以考虑 nz-transfer 暂时先不使用 OnPush 做兼容处理

@cipchk
Copy link
Member

cipchk commented Jan 31, 2018

其实好奇的是若指定 nzSelectChange 就正常;一头雾水。

@create-share
Copy link
Contributor Author

create-share commented Jan 31, 2018

我猜是因为 nz-transfernzSelectChange事件是从在 nz-transfer-list template <li *ngIf="!item._hiden" (click)="_handleSelect(item)" class="ant-transfer-list-content-item"> 中的 click 事件一路过来的,所以指定 nzSelectChange 的话使得 markForCheck 发生在 nz-transfer-list 组件而不是 nz-transfer 组件?

@vthinkxie
Copy link
Member

@deart1mer is right

@vthinkxie
Copy link
Member

@cipchk please check if this bug was fixed in version 0.7.0

@lock
Copy link

lock bot commented Apr 4, 2019

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 4, 2019
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants