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(Space): modify the priority of the component's size #42752

Merged
merged 4 commits into from Jun 19, 2023

Conversation

linxianxi
Copy link
Contributor

@linxianxi linxianxi commented May 31, 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

#42724

💡 Background and solution

组件自己的 size 属性优先级最高

📝 Changelog

Language Changelog
🇺🇸 English modify the priority of the component's size
🇨🇳 Chinese 修改组件自身 size 的优先级判断

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

This pull request fixes a bug where some components do not respect the size prop when used inside a Form.Item with compact layout. It also improves the consistency and flexibility of the Space component and its sub-components by removing the default size value in the Compact component. The affected components are Cascader, DatePicker, InputNumber, Input.Search, Select, TreeSelect, and Space.Compact.

🔍 Walkthrough

🤖 Generated by Copilot at e8b3dbe

  • Swap the order of compactSize and customizeSize in the useSize hook of several components to give higher priority to the size prop when used inside a Form.Item with compact layout (link, link, link, link, link, link, link). This fixes a bug where the size prop was ignored by the Cascader, RangePicker, Picker, InputNumber, Search, Select, and TreeSelect components.

@github-actions
Copy link
Contributor

github-actions bot commented May 31, 2023

@MadCcc
Copy link
Member

MadCcc commented May 31, 2023

加一下测试用例吧

@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (c3372d6) 100.00% compared to head (1f40749) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #42752   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          648       648           
  Lines        10957     10957           
  Branches      2975      2975           
=========================================
  Hits         10957     10957           
Impacted Files Coverage Δ
components/button/button.tsx 100.00% <100.00%> (ø)
components/cascader/index.tsx 100.00% <100.00%> (ø)
...date-picker/generatePicker/generateRangePicker.tsx 100.00% <100.00%> (ø)
...ate-picker/generatePicker/generateSinglePicker.tsx 100.00% <100.00%> (ø)
components/input-number/index.tsx 100.00% <100.00%> (ø)
components/input/Input.tsx 100.00% <100.00%> (ø)
components/input/Search.tsx 100.00% <100.00%> (ø)
components/select/index.tsx 100.00% <100.00%> (ø)
components/space/Compact.tsx 100.00% <100.00%> (ø)
components/tree-select/index.tsx 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@linxianxi
Copy link
Contributor Author

@MadCcc 看下

@MadCcc MadCcc merged commit 8a4203b into ant-design:master Jun 19, 2023
52 checks passed
@PeachScript PeachScript mentioned this pull request Jun 25, 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