From 8c284cfae0fa1ff7ff372ed0033d122493919d29 Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Mon, 21 Aug 2023 16:00:28 +0800 Subject: [PATCH 1/2] fix(input-group): layout style --- components/input/style/index.ts | 48 ++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/components/input/style/index.ts b/components/input/style/index.ts index f3d37358be..7653f78707 100644 --- a/components/input/style/index.ts +++ b/components/input/style/index.ts @@ -230,15 +230,6 @@ export const genInputGroupStyle = (token: InputToken): CSSObject => { ...genInputSmallStyle(token), }, - // Fix https://github.com/ant-design/ant-design/issues/5754 - [`&-lg ${antCls}-select-single ${antCls}-select-selector`]: { - height: token.controlHeightLG, - }, - - [`&-sm ${antCls}-select-single ${antCls}-select-selector`]: { - height: token.controlHeightSM, - }, - [`> ${componentCls}`]: { display: 'table-cell', @@ -501,6 +492,45 @@ export const genInputGroupStyle = (token: InputToken): CSSObject => { }, }, }, + + [`&&-sm ${antCls}-btn`]: { + fontSize: token.fontSizeSM, + height: token.controlHeightSM, + lineHeight: 'normal', + }, + + [`&&-lg ${antCls}-btn`]: { + fontSize: token.fontSizeLG, + height: token.controlHeightLG, + lineHeight: 'normal', + }, + + // Fix https://github.com/ant-design/ant-design/issues/5754 + [`&&-lg ${antCls}-select-single ${antCls}-select-selector`]: { + height: `${token.controlHeightLG}px`, + + [`${antCls}-select-selection-item, ${antCls}-select-selection-placeholder`]: { + // -2 is for the border size & override default + lineHeight: `${token.controlHeightLG - 2}px`, + }, + + [`${antCls}-select-selection-search-input`]: { + height: `${token.controlHeightLG}px`, + }, + }, + + [`&&-sm ${antCls}-select-single ${antCls}-select-selector`]: { + height: `${token.controlHeightSM}px`, + + [`${antCls}-select-selection-item, ${antCls}-select-selection-placeholder`]: { + // -2 is for the border size & override default + lineHeight: `${token.controlHeightSM - 2}px`, + }, + + [`${antCls}-select-selection-search-input`]: { + height: `${token.controlHeightSM}px`, + }, + }, }; }; From 38d356109fe392aa54c113c2ae18a1c5b3989535 Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Mon, 21 Aug 2023 16:17:56 +0800 Subject: [PATCH 2/2] tests: update snapshot --- .../__tests__/__snapshots__/demo.test.js.snap | 54 +++++++++++++------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index 416dd244ca..fc988d2588 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -50,26 +50,37 @@ exports[`renders ./components/input/demo/basic.vue correctly 1`] = ` exports[`renders ./components/input/demo/borderless.vue correctly 1`] = ``; exports[`renders ./components/input/demo/group.vue correctly 1`] = ` -