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

Tree: revert pr #13349 #14847

Merged
merged 1 commit into from
Mar 27, 2019
Merged

Tree: revert pr #13349 #14847

merged 1 commit into from
Mar 27, 2019

Conversation

ziyoung
Copy link
Contributor

@ziyoung ziyoung commented Mar 26, 2019

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow Element's contributing guide (中文 | English | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer relative issues for you PR.

@element-bot
Copy link
Member

Deploy preview for element ready!

Built with commit 353d1ad

https://deploy-preview-14847--element.netlify.com

@ziyoung
Copy link
Contributor Author

ziyoung commented Mar 26, 2019

解释一下为何要把 #13349 的代码删除掉?


懒加载完成,不应该去重新调用 reinitChecked 函数。假设当前节点是选中的,加载了数据(新增的子节点没有选择),调用 reinitChecked,该节点便没有选中。


#13349 关联的是 issue #12383,正确的解决方式应该是手动调用 setCheckedKeys https://jsfiddle.net/x47j0dr6/

@ziyoung ziyoung added this to the 2.7.0 milestone Mar 27, 2019
@iamkun iamkun merged commit 314e7fb into ElemeFE:dev Mar 27, 2019
@ziyoung ziyoung deleted the issue/14341 branch April 2, 2019 07:29
weisiren168 pushed a commit to weisiren168/element that referenced this pull request Jun 20, 2019
@yangmiao7
Copy link

yangmiao7 commented Sep 23, 2019

https://jsfiddle.net/x47j0dr6/ 案例中的情况只能用于load中的异步操作已经执行完毕,然后再用setCheckedKeys 进行勾选回显设置,业务中常见的懒加载情况为,load中的异步操作可能在不可预知的时间执行完毕,也初始化需要展开的展开项目为多个,load会多次执行,这个时候没法确定什么时间调用setCheckedKeys函数,只要setCheckedKeys不是在所有load异步操作结束之后调用的,就可能依然有问题

示例代码:https://jsfiddle.net/wtrvx13z/1/

请问这种情况推荐如何处理

@sonymoon
Copy link

sonymoon commented May 2, 2022

我真的遇到 #13349 说的问题了,lazy模式下,子节点前两个设置为默认选中,然后整个父节点全被选中。
最新版本2.15.7,为啥要revert呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The tree component's bug
5 participants