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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion components/select/style/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const getSearchInputWithoutBorderStyle: GenerateStyle<SelectToken, CSSObject> =

// =============================== Base ===============================
const genBaseStyle: GenerateStyle<SelectToken> = (token) => {
const { componentCls, inputPaddingHorizontalBase, iconCls } = token;
const { antCls, componentCls, inputPaddingHorizontalBase, iconCls } = token;

return {
[componentCls]: {
Expand All @@ -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.

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

...textEllipsis,

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

Choose a reason for hiding this comment

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

这段代码导致 #46636 错误

},

// ======================= Placeholder =======================
Expand Down
2 changes: 0 additions & 2 deletions components/select/style/multiple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ function genSizeStyle(token: SelectToken, suffix?: string): CSSObject {

// ======================== Selections ========================
[`${componentCls}-selection-item`]: {
position: 'relative',
display: 'flex',
flex: 'none',
boxSizing: 'border-box',
Expand All @@ -100,7 +99,6 @@ function genSizeStyle(token: SelectToken, suffix?: string): CSSObject {
borderRadius: token.borderRadiusSM,
cursor: 'default',
transition: `font-size ${token.motionDurationSlow}, line-height ${token.motionDurationSlow}, height ${token.motionDurationSlow}`,
userSelect: 'none',
marginInlineEnd: FIXED_ITEM_MARGIN * 2,
paddingInlineStart: token.paddingXS,
paddingInlineEnd: token.paddingXS / 2,
Expand Down
5 changes: 0 additions & 5 deletions components/select/style/single.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ function genSizeStyle(token: SelectToken, suffix?: string): CSSObject {
},
},

[`${componentCls}-selection-item`]: {
position: 'relative',
userSelect: 'none',
},

[`${componentCls}-selection-placeholder`]: {
transition: 'none',
pointerEvents: 'none',
Expand Down