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

bug fix : expand all leaf nodes in root level #47567

Merged
merged 13 commits into from Feb 24, 2024
Merged

Conversation

wkmyws
Copy link
Contributor

@wkmyws wkmyws commented Feb 23, 2024

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

#47552

💡 Background and solution

使用DirectoryTree且multiple = true的时候,当treeData的isLeaf都为true,defaultExpandAll为false,按住shift连续多选会报错

因为initExpandedKeys在这个情况下是undefined,而事实上,对于第一层的叶子节点(root leaf nodes),应该把它们的key加入到initExpandedKeys列表中

📝 Changelog

Language Changelog
🇺🇸 English Fix the issue of holding down shift and continuously selecting multiple errors when using DirectoryTree
🇨🇳 Chinese 修复使用DirectoryTree时,按住shift连续多选报错的问题

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

stackblitz bot commented Feb 23, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

github-actions bot commented Feb 23, 2024

👁 Visual Regression Report for PR #47567 Passed ✅

🎯 Target branch: master (53b0106)
📖 View Full Report ↗︎

🎊 Congrats! No visual-regression diff found.

Copy link
Contributor

github-actions bot commented Feb 23, 2024

Preview is ready

Copy link

codesandbox-ci bot commented Feb 23, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 99.98%. Comparing base (cebe217) to head (2e56862).

❗ Current head 2e56862 differs from pull request most recent head 25ec3f8. Consider uploading reports for the commit 25ec3f8 to get more accurate results

Files Patch % Lines
components/tree/DirectoryTree.tsx 77.77% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##            master   #47567      +/-   ##
===========================================
- Coverage   100.00%   99.98%   -0.02%     
===========================================
  Files          734      734              
  Lines        12890    12600     -290     
  Branches      3440     3299     -141     
===========================================
- Hits         12890    12598     -292     
- Misses           0        2       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yoyo837
Copy link
Contributor

yoyo837 commented Feb 23, 2024

我加的fix不对吗?这个PR不能修复那个问题?

@yoyo837 yoyo837 linked an issue Feb 23, 2024 that may be closed by this pull request
@wkmyws
Copy link
Contributor Author

wkmyws commented Feb 23, 2024

我加的fix不对吗?这个PR不能修复那个问题?

额,你加的fix在哪,有链接我看看吗

@yoyo837
Copy link
Contributor

yoyo837 commented Feb 23, 2024

image

@wkmyws
Copy link
Contributor Author

wkmyws commented Feb 23, 2024

image

懂你意思了,我一开始以为你已经提了一个pr。

因为我直接基于第一个版本加了change log,没注意你后来加了文字"fix",抱歉,你再加上去吧😊

@yoyo837
Copy link
Contributor

yoyo837 commented Feb 23, 2024

image

我加到这里一样的

@yoyo837
Copy link
Contributor

yoyo837 commented Feb 23, 2024

请添加测试用例

@wkmyws
Copy link
Contributor Author

wkmyws commented Feb 24, 2024

请添加测试用例

已添加测试用例

@yoyo837 yoyo837 merged commit 1b69651 into ant-design:master Feb 24, 2024
60 checks passed
Copy link
Contributor

🎉 Thank you for your contribution! If you have not yet joined our DingTalk community group, please feel free to join us (when joining, please provide the link to this PR).

🎉 感谢您的贡献!如果您还没有加入钉钉社区群,请扫描下方二维码加入我们(加群时请提供此 PR 链接)。

tanzhenyun pushed a commit to DraculaPrince/mark15 that referenced this pull request Mar 29, 2024
* fix table's scrollbar background color in dark mode

* docs : fix "fille" with "filled"

* expand all leaf nodes in root level

* Add type annotation

* code style format

* [CodeFactor] Apply fixes to commit 116efaf

[ci skip] [skip ci]

* simplify the code and add the corresponding testing module

---------

Co-authored-by: codefactor-io <support@codefactor.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

使用DirectoryTree时,按住shift连续多选报错
4 participants