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 use value width instead of default fixed width #20538
Conversation
Deploy preview for ant-design ready! Built with commit 9ed5b7e |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 9ed5b7e:
|
Codecov Report
@@ Coverage Diff @@
## 4.0-prepare #20538 +/- ##
============================================
Coverage 97.56% 97.56%
============================================
Files 295 295
Lines 6771 6771
Branches 1831 1869 +38
============================================
Hits 6606 6606
Misses 165 165 Continue to review full report at Codecov.
|
Will create another PR to fix Chrome align. |
&::after, | ||
.@{select-prefix-cls}-selection-placeholder::after { | ||
line-height: @select-height-without-border; | ||
content: '\a0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\a0
是啥?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
空字符,同下用来 baseline align 占位用的。
components/select/style/single.less
Outdated
|
||
&::after, | ||
.@{select-prefix-cls}-selection-placeholder::after { | ||
line-height: @select-height-without-border; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个应该不需要。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有文字的时候 baseline align 会错位,需要一个带 line-height 的元素 align 一下。
测试了一下 4.0 的样式里这个对齐的 magic number 变成了 border-top-width: 1.375px; |
先用 magic number align 一下,之后开个新的 PR 整体调一下。以后都以 span align 为准:
|
不一定有 |
这两个是配合的:
|
content: '\a0';
- line-height: @select-height-without-border; 貌似不需要这个也能对齐。 |
重现不出来了,我也不知道为啥这么写了。删了。 |
🤔 This is a ...
🔗 Related issue link
fix #20394
💡 Background and solution
📝 Changelog
☑️ Self Check before Merge