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: Form 与 Grid 样式冲突问题 #44472

Merged
merged 3 commits into from Aug 28, 2023
Merged

fix: Form 与 Grid 样式冲突问题 #44472

merged 3 commits into from Aug 28, 2023

Conversation

crazyair
Copy link
Member

@crazyair crazyair commented Aug 28, 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

close: #44456

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Form.Item children not hidden when 'wrapperCol.span' is '0'.
🇨🇳 Chinese 修复 Form.Item 设置 wrapperCol.span0 时,子元素不隐藏的问题。

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

This pull request enhances the grid component's style customization by adding a rootPrefixCls parameter to its style functions and hooks. This allows users to change the class name prefix for the grid elements in components/grid/style/index.ts.

🔍 Walkthrough

🤖 Generated by Copilot at cc0ab4e

  • Add rootPrefixCls parameter to grid style functions and pass it to genLoopGridColumnsStyle function to generate class name prefix for grid columns (link, link, link, link, link)
  • Wrap gridColumnsStyle object in another object with .${rootPrefixCls}-row key to target grid row element in genGridStyle function (link)
  • Add rootPrefixCls property to second argument of genComponentStyleHook function call in useColStyle function, which is a custom hook that returns style objects for grid column component (link)
  • Add an empty line at the beginning of components/grid/style/index.ts file for code formatting and readability (link)

@stackblitz
Copy link

stackblitz bot commented Aug 28, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2023

@crazyair crazyair changed the title fix: style fix: Form 与 Grid 样式冲突问题 Aug 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 388.58 KB (-286 B 🔽)
./dist/antd-with-locales.min.js 447.5 KB (-238 B 🔽)

@crazyair crazyair added the 🐛 Bug Ant Design Team had proved that this is a bug. label Aug 28, 2023
@argos-ci
Copy link

argos-ci bot commented Aug 28, 2023

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

Build Status Details Updated (UTC)
default (Inspect) ✅ No change detected - Aug 28, 2023, 1:53 PM

@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (bbbc3d9) 100.00% compared to head (9625bf0) 100.00%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #44472   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          661       661           
  Lines        11231     11272   +41     
  Branches      3042      3060   +18     
=========================================
+ Hits         11231     11272   +41     
Files Changed Coverage Δ
components/grid/style/index.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

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

@@ -92,7 +93,7 @@ const genLoopGridColumnsStyle = (token: GridColToken, sizeCls: string): CSSObjec
const gridColumnsStyle: CSSObject = {};
for (let i = gridColumns; i >= 0; i--) {
if (i === 0) {
gridColumnsStyle[`${componentCls}${sizeCls}-${i}`] = {
gridColumnsStyle[`${componentCls}${componentCls}${componentCls}${sizeCls}-${i}`] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加个备注说明一下为什么要加两层,其他没什么~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@zombieJ zombieJ removed the 🐛 Bug Ant Design Team had proved that this is a bug. label Aug 28, 2023
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.

Form 与 Grid 样式冲突问题
2 participants