element-plus icon indicating copy to clipboard operation
element-plus copied to clipboard

fix(components): [el-tree-select] fix lazy and multiple select node

Open gaoxuan-haxibiao opened this issue 1 year ago • 5 comments

1.Fix the issue where non-leaf nodes cannot be selected when using lazy and multiple together.

  1. Since the original code did not handle the selection of non-leaf nodes before expanding lazy-loaded child nodes, additional processing was added to link the selection of parent and child nodes.

  2. Because the time required for lazyLoad after nodeExpand cannot be predicted, the triggering time of the node-expand event in the tree has been adjusted to occur within the callback of the expand function. This change only affects the timing when using lazyLoad.

BREAKING CHANGE : no

closed closed Fixes #17232

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

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

gaoxuan-haxibiao avatar Aug 15 '24 06:08 gaoxuan-haxibiao

👋 @gaoxuan-haxibiao, seems like this is your first time contribution to element-plus.

  • Please make sure that you have read our guidelines and code of conduct before making a contribution.
  • You can comment with /label Components:[component_name] to add a label for which component you are working on.
  • You may join our Discord for staying tuned.

Hello @gaoxuan-haxibiao, thank you for contributing to element-plus, please see our guideline to see how to make contribution

github-actions[bot] avatar Aug 15 '24 06:08 github-actions[bot]

github-actions[bot] avatar Aug 15 '24 06:08 github-actions[bot]

🧪 Playground Preview: https://element-plus.run/?pr=17903 Please comment the example via this playground if needed.

github-actions[bot] avatar Aug 15 '24 06:08 github-actions[bot]

When selecting a non-leaf node, the display of modelValue was designed with reference to the SHOW_CHILD strategy from Ant Design TreeSelect showCheckedStrategy. Has element-plus considered adding a showCheckedStrategy prop to the TreeSelect component?

gaoxuan-haxibiao avatar Aug 15 '24 06:08 gaoxuan-haxibiao

@tolking @btea Can review and merge this pr? Thank you!

gaoxuan-haxibiao avatar Aug 29 '24 03:08 gaoxuan-haxibiao

Thanks!

btea avatar Sep 01 '24 12:09 btea