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

feat: SelectLike components support z-index manager #45494

Merged
merged 8 commits into from Oct 24, 2023

Conversation

kiner-tang
Copy link
Member

@kiner-tang kiner-tang commented Oct 23, 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

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Cascader、TreeSelect、AutoComplete Support z-index context to manage z-index
🇨🇳 Chinese Cascader、TreeSelect、AutoComplete 支持通过 z-index 上下文管理 z-index

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

Use the useZIndex hook to manage the zIndex of dropdown menus in various components. This hook respects the existing props and contexts that affect the zIndex, and ensures a consistent and compatible behavior across different components and scenarios. Simplify and activate the test cases for the useZIndex hook.

🔍 Walkthrough

🤖 Generated by Copilot at 2ab55c9

  • Import and call the useZIndex hook in the auto-complete, cascader, dropdown, select, and tree-select components, to manage the zIndex of their dropdown or overlay menus (link, link, link, link, link, link, link, link, link, link, link)
  • Apply the zIndex value returned by the useZIndex hook to the dropdownStyle or overlayStyle props of the underlying Rc components, overriding the original zIndex if any (link, link, link, link)
  • Simplify the dropdownStyle prop of the InternalSelect component to use only the zIndex value returned by the useZIndex hook, instead of conditionally using the zIndex prop from the dropdownStyle prop or the zIndex value from the ConfigProvider (link)
  • Import and provide the zIndexContext in the dropdown component, to pass the contextZIndex value returned by the useZIndex hook to the nested consumer components (link, link)
  • Modify and enable the test cases for the useZIndex hook in the components/_util/__tests__/useZIndex.test.tsx file, to use specific consumer components (Dropdown and SelectLike) instead of all the possible ones, and to verify the functionality of the hook after the consumer components have been merged (link, link)

@stackblitz
Copy link

stackblitz bot commented Oct 23, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2023

Preview Is ready

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 399.59 KB (+81 B 🔺)
./dist/antd-with-locales.min.js 458.9 KB (+77 B 🔺)

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6d9db9f) 100.00% compared to head (400af83) 100.00%.

Additional details and impacted files
@@                    Coverage Diff                     @@
##           refactor-z-index-context    #45494   +/-   ##
==========================================================
  Coverage                    100.00%   100.00%           
==========================================================
  Files                           697       697           
  Lines                         11738     11740    +2     
  Branches                       3138      3137    -1     
==========================================================
+ Hits                          11738     11740    +2     
Files Coverage Δ
components/auto-complete/index.tsx 100.00% <100.00%> (ø)
components/cascader/index.tsx 100.00% <100.00%> (ø)
components/select/index.tsx 100.00% <ø> (ø)
components/tree-select/index.tsx 100.00% <100.00%> (ø)

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

@kiner-tang kiner-tang merged commit 3cb2738 into refactor-z-index-context Oct 24, 2023
88 checks passed
@kiner-tang kiner-tang deleted the feat-z-index-selectLike branch October 24, 2023 03:49
@MadCcc MadCcc mentioned this pull request Nov 3, 2023
20 tasks
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