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

fix(tree-select): 删除父节点的最后一个子节点后选中了另外的子节点. #3508 #3586

Closed
wants to merge 1 commit into from

Conversation

jy0529
Copy link
Contributor

@jy0529 jy0529 commented Jan 24, 2021

这个变动的性质是

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 组件样式改进
  • TypeScript 定义更新
  • 重构
  • 代码风格优化
  • 分支合并
  • 其他改动(是关于什么的改动?)

需求背景

  1. 描述相关需求的来源。
  2. 要解决的问题。
  3. 相关的 issue 讨论链接。

删除父节点的最后一个子节点后选中了另外的子节点, 相关issue: #3508

实现方案和 API(非新功能可选)

原因
isPosRelated方法判断节点的关系时,只判断了父子节点,没有判断兄弟节点,e.g. 1-2-3 related with 1-2-4

看了rc-tree-select,新版已经采用hooks来重写了,没这问题。
2.9.x版本有问题,可以看:http://react-component.github.io/tree-select/examples/basic.html

修复方式:isPosRelated增加对兄弟节点的判断,兄弟节点的关系返回true

影响范围:只在onMultipleSelectorRemove,删除节点的情况下采用

请求合并前的自查清单

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

Base automatically changed from master to 1.x March 16, 2021 02:00
@tangjinzhou
Copy link
Member

你这个改动,当只选中部分子节点的时候,会同时删除这些节点

@tangjinzhou
Copy link
Member

tangjinzhou commented May 8, 2021

ref #3942
等这个 merge 了 参考这个提交 pr

@github-actions
Copy link

github-actions bot commented Jul 8, 2021

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Jul 8, 2021
@github-actions github-actions bot closed this Jul 16, 2021
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants