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 not trigger onOpenChange when click menu item #45378

Merged
merged 5 commits into from Oct 17, 2023

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Oct 17, 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

ref #45371

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Dropdown not trigger onOpenChange when click menu item to close the popup.
🇨🇳 Chinese 修复 Dropdown 在点击菜单项关闭弹出框时不会触发 onOpenChange 的问题。

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

This pull request fixes a bug in the Dropdown component that prevented the menu from closing after selecting an item. It adds a test case and a line of code to call the onOpenChange prop with false in components/dropdown/__tests__/index.test.tsx and components/dropdown/dropdown.tsx, respectively.

🔍 Walkthrough

🤖 Generated by Copilot at b13ca6e

  • Close the dropdown menu when an item is clicked (link, link)

@stackblitz
Copy link

stackblitz bot commented Oct 17, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 398.75 KB (+29 B 🔺)
./dist/antd-with-locales.min.js 458.07 KB (+32 B 🔺)

@argos-ci
Copy link

argos-ci bot commented Oct 17, 2023

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

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 1 change Oct 17, 2023, 6:24 AM

@zombieJ zombieJ changed the base branch from master to feature October 17, 2023 03:57
@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (d8140e0) 100.00% compared to head (81530af) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #45378   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          695       695           
  Lines        11707     11709    +2     
  Branches      3127      3128    +1     
=========================================
+ Hits         11707     11709    +2     
Files Coverage Δ
components/dropdown/dropdown.tsx 100.00% <100.00%> (ø)
...omponents/table/hooks/useFilter/FilterDropdown.tsx 100.00% <100.00%> (ø)

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

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.

None yet

2 participants