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(Dropdown): Prevented closing if menu is in multiple mode #45513

Merged
merged 5 commits into from Oct 26, 2023

Conversation

vyachsed
Copy link
Contributor

@vyachsed vyachsed commented Oct 24, 2023

[中文版模板 / 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

fix #45520

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Dropdown always closes after clicking on an item
🇨🇳 Chinese

☑️ 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

🚀 Summary

🤖 Generated by Copilot at d3240af

Fixed a bug in dropdown.tsx that caused the dropdown menu to close when selecting multiple options. Added menu prop as a dependency to onMenuClick function.

🔍 Walkthrough

🤖 Generated by Copilot at d3240af

  • Prevent closing dropdown menu when multiple selectable (link)
  • Add menu prop as dependency to onMenuClick function (link)

@stackblitz
Copy link

stackblitz bot commented Oct 24, 2023

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

@github-actions
Copy link
Contributor

  • 🚨 Please fill changelog in the PR

    • Write with a developer-oriented perspective and narrative method, without describing the details of the repair
    • Describing the problem and the impact on the developer
    • describing the user-first site problem, not your solution
    • Refer: https://ant.design/changelog#501
  • 🚨 请填写 PR 中的 changelog

    • 请用面向开发者的角度叙述方式撰写,不描述修复细节
    • 描述问题和对开发者的影响
    • 描述用户第一现场的问题,而非你的解决方式
    • 参考:https://ant.design/changelog-cn#501

@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2023

Preview Is ready

@argos-ci
Copy link

argos-ci bot commented Oct 24, 2023

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No change detected - Oct 25, 2023, 7:24 PM

@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (41b3409) 100.00% compared to head (077bd7f) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #45513   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          694       694           
  Lines        11678     11680    +2     
  Branches      3120      3121    +1     
=========================================
+ Hits         11678     11680    +2     
Files Coverage Δ
components/dropdown/dropdown.tsx 100.00% <100.00%> (ø)

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

Signed-off-by: Vyacheslav Sedykh <zlav24va@mail.ru>
@afc163
Copy link
Member

afc163 commented Oct 25, 2023

Could you add a test case?

@vyachsed
Copy link
Contributor Author

Could you add a test case?

Do you mean formalized issue (#45520)? Or should I add some tests for my changes?

Co-authored-by: afc163 <afc163@gmail.com>
Signed-off-by: Vyacheslav Sedykh <zlav24va@mail.ru>
@afc163
Copy link
Member

afc163 commented Oct 25, 2023

Right, the original problem should be covered.

@vyachsed
Copy link
Contributor Author

vyachsed commented Oct 25, 2023

Right, the original problem should be covered.

Sorry, didn't catch you.
Do you mean that the problem should be described? (It's done, I attached the issue link)
Or do you mean that I should cover my code with tests?
So, is there something I need to do?

@afc163
Copy link
Member

afc163 commented Oct 25, 2023

We should add test case (such as https://github.com/ant-design/ant-design/blob/master/components/avatar/__tests__/Avatar.test.tsx ) for your changes, in case that the original problem happen again.

@vyachsed
Copy link
Contributor Author

We should add test case (such as https://github.com/ant-design/ant-design/blob/master/components/avatar/__tests__/Avatar.test.tsx ) for your changes, in case that the original problem happen again.

Done

@afc163 afc163 merged commit f3cf13a into ant-design:master Oct 26, 2023
53 checks passed
@kienntt
Copy link

kienntt commented Nov 24, 2023

When i upgrade to version 5.11.3 it still closes after clicking on an item, then i comback version 5.10.3

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.

Dropdown closing if menu is in multiple mode
4 participants