diff --git a/components/date-picker/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/date-picker/__tests__/__snapshots__/demo-extend.test.ts.snap index 97357686ec..49a90ec5ab 100644 --- a/components/date-picker/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/date-picker/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -42616,6 +42616,3033 @@ exports[`renders components/date-picker/demo/multiple.tsx extend context correct exports[`renders components/date-picker/demo/multiple.tsx extend context correctly 2`] = `[]`; +exports[`renders components/date-picker/demo/multiple-debug.tsx extend context correctly 1`] = ` +
Basic
Range Picker
Multiple
+Multiple Debug
Need Confirm
Switchable picker
Date Format
diff --git a/components/date-picker/index.zh-CN.md b/components/date-picker/index.zh-CN.md
index e5ad61c7a9..634bfbb960 100644
--- a/components/date-picker/index.zh-CN.md
+++ b/components/date-picker/index.zh-CN.md
@@ -20,6 +20,7 @@ demo:
基本
范围选择器
多选
+多选 Debug
选择确认
切换不同的选择器
日期格式
diff --git a/components/date-picker/style/multiple.ts b/components/date-picker/style/multiple.ts
index 0ef740594c..51b809ca93 100644
--- a/components/date-picker/style/multiple.ts
+++ b/components/date-picker/style/multiple.ts
@@ -1,19 +1,26 @@
import type { CSSInterpolation } from '@ant-design/cssinjs';
-import { genSelectionStyle } from '../../select/style/multiple';
+import { FIXED_ITEM_MARGIN, genSelectionStyle } from '../../select/style/multiple';
import { mergeToken, type GenerateStyle } from '../../theme/internal';
import type { PickerToken } from './token';
const genSize = (token: PickerToken, suffix?: string): CSSInterpolation => {
- const { componentCls, selectHeight, fontHeight, lineWidth, calc } = token;
+ const { componentCls, selectHeight, fontHeight, lineWidth, controlHeight, calc } = token;
const suffixCls = suffix ? `${componentCls}-${suffix}` : '';
const height = token.calc(fontHeight).add(2).equal();
const restHeight = () => calc(selectHeight).sub(height).sub(calc(lineWidth).mul(2));
- const paddingTop = token.max(restHeight().div(2).equal(), 0);
- const paddingBottom = token.max(restHeight().sub(paddingTop).equal(), 0);
+ const paddingBase = token.max(restHeight().div(2).equal(), 0);
+ const paddingTop = token.max(token.calc(paddingBase).sub(FIXED_ITEM_MARGIN).equal(), 0);
+ const paddingBottom = token.max(
+ restHeight()
+ .sub(paddingTop)
+ .sub(FIXED_ITEM_MARGIN * 2)
+ .equal(),
+ 0,
+ );
return [
genSelectionStyle(token, suffix),
@@ -21,7 +28,8 @@ const genSize = (token: PickerToken, suffix?: string): CSSInterpolation => {
[`${componentCls}-multiple${suffixCls}`]: {
paddingTop,
paddingBottom,
- paddingInlineStart: paddingTop,
+ paddingInlineStart: paddingBase,
+ minHeight: controlHeight,
},
},
];
@@ -36,6 +44,7 @@ const genPickerMultipleStyle: GenerateStyle