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: Select alignment issue when label is Typography #44756

Merged
merged 1 commit into from Sep 11, 2023

Conversation

afc163
Copy link
Member

@afc163 afc163 commented Sep 11, 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 #40421

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Select alignment issue when label is Typography
🇨🇳 Chinese 修复 Select 的 label 为 Typography 组件时的选中文本对齐问题。

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

Fixed some style issues and bugs in the select component and its variants. Added a new antCls property to the genSizeStyle function to support customizing the ant design class prefix.

🔍 Walkthrough

🤖 Generated by Copilot at 50a9a20

  • Add antCls property to token parameter of genSizeStyle function in both multiple.tsx and single.tsx files to access ant-design prefix class name for typography components (link, link)
  • Add CSS rule to set display property of typography components to inline in genSizeStyle function in both multiple.tsx and single.tsx files to fix overflow bug for select components (link, link)

@stackblitz
Copy link

stackblitz bot commented Sep 11, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 11, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Sep 11, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 393.44 KB (+16 B 🔺)
./dist/antd-with-locales.min.js 452.63 KB (+10 B 🔺)

@@ -239,7 +239,14 @@ const genBaseStyle: GenerateStyle<SelectToken> = (token) => {
[`${componentCls}-selection-item`]: {
flex: 1,
fontWeight: 'normal',
position: 'relative',
userSelect: 'none',
Copy link
Member Author

Choose a reason for hiding this comment

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

两段重复的代码也合并过来。

@argos-ci
Copy link

argos-ci bot commented Sep 11, 2023

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

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 1 change Sep 11, 2023, 5:57 AM

@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (3e97fee) 100.00% compared to head (788a3ca) 100.00%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #44756   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          680       680           
  Lines        11417     11417           
  Branches      3073      3073           
=========================================
  Hits         11417     11417           
Files Changed Coverage Δ
components/select/style/multiple.tsx 100.00% <ø> (ø)
components/select/style/single.tsx 100.00% <ø> (ø)

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

Comment on lines +246 to +249
// https://github.com/ant-design/ant-design/issues/40421
[`> ${antCls}-typography`]: {
display: 'inline',
},
Copy link
Member

Choose a reason for hiding this comment

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

这段代码导致 #46636 错误

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.

Text alignment issue with Typography component in Select component
3 participants