-
-
Notifications
You must be signed in to change notification settings - Fork 49.2k
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: menu inline collapsed show without icon #24330
Conversation
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.
ant-design/components/avatar/index.tsx Line 88 in f646b6f
Avatar 默认两边各留了 4px 的边界,计划增加一个 API 可以控制这个值 这样的话,在这个地方 会更完善一些 what do you think? |
Codecov Report
@@ Coverage Diff @@
## master #24330 +/- ##
=======================================
Coverage 99.10% 99.10%
=======================================
Files 363 363
Lines 7230 7234 +4
Branches 1966 2009 +43
=======================================
+ Hits 7165 7169 +4
Misses 65 65
Continue to review full report at Codecov.
|
/rebase |
fc100a8
to
68bc12b
Compare
可行,不过就要发到 feature 分支了。 |
components/menu/style/index.less
Outdated
@@ -1,5 +1,6 @@ | |||
@import '../../style/themes/index'; | |||
@import '../../style/mixins/index'; | |||
@import '../../avatar/index'; |
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.
样式依赖要放在 style/index.ts 中。
😂😂😂 如果是第一个字符,完全没必要 Avatar 了啊 |
带个圈当背景,图形整体性会强很多。 |
一个 N/O 感觉像是乱码。 |
我觉得有 必要 确认下要用哪种方式 😂😂 如果带圈,圈的的大小,边框色,背景色都需权衡下 |
这种时候该视觉的同志勇敢的站出来说话了 |
这么看似乎都不用 Avatar 了,直接 children 第一个字母就成了。 |
那就首字母吧,不用 Avatar 了。 |
首字母的话,需要带圈吗?实心圈 还是 光有边框的? |
首字母 一样 岂不是很尴尬 |
// inline-collapsed.md demo 依赖 span 来隐藏文字,有 icon 属性,则内部包裹一个 span | ||
// ref: https://github.com/ant-design/ant-design/pull/23456 | ||
if (!icon || (isValidElement(children) && children.type === 'span')) { | ||
if (children && inlineCollapsed && level === 1 && typeof children === 'string') { | ||
return <p>{children.charAt(0)}</p>; | ||
} | ||
return children; |
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.
其实 children 为空的话,要不要 span 都行。
换了种方式,保持原有 snap 。
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.
为啥是 p ?
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.
用 span 加 className 呢。
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.
试了 span ,不太行。换成了 div
图标是span,没办法区分,然后用了p
|
加class可以,我晚上改成这种的。
|
@shaodahong,用更新的方式更新 UI test 评论,否则留言太多了。 |
嗯。是这么做的,但是 rebase 后的评论就拉不到了…… |
|
神奇…… |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
close #24311
💡 Background and solution
Avatar
component to automatically adjust the font size of contentRendering
📝 Changelog
☑️ Self Check before Merge
View rendered components/menu/demo/inline-collapsed.md