From f4ada6b7dc4972a1ad58bd5060a15a21d024aba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Tue, 16 Apr 2024 11:53:59 +0800 Subject: [PATCH] fix: dom order (#799) --- .../Selector/SingleSelector/MultipleDates.tsx | 13 ++++++++++++- src/PickerInput/Selector/SingleSelector/index.tsx | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/PickerInput/Selector/SingleSelector/MultipleDates.tsx b/src/PickerInput/Selector/SingleSelector/MultipleDates.tsx index 47cbd2a8e..670e7ba47 100644 --- a/src/PickerInput/Selector/SingleSelector/MultipleDates.tsx +++ b/src/PickerInput/Selector/SingleSelector/MultipleDates.tsx @@ -11,12 +11,22 @@ export interface MultipleDatesProps removeIcon?: React.ReactNode; formatDate: (date: DateType) => string; disabled?: boolean; + placeholder?: React.ReactNode; } export default function MultipleDates( props: MultipleDatesProps, ) { - const { prefixCls, value, onRemove, removeIcon = '×', formatDate, disabled, maxTagCount } = props; + const { + prefixCls, + value, + onRemove, + removeIcon = '×', + formatDate, + disabled, + maxTagCount, + placeholder, + } = props; const selectorCls = `${prefixCls}-selector`; const selectionCls = `${prefixCls}-selection`; @@ -76,6 +86,7 @@ export default function MultipleDates( itemKey={(date) => formatDate(date)} maxCount={maxTagCount} /> + {!value.length && {placeholder}} ); } diff --git a/src/PickerInput/Selector/SingleSelector/index.tsx b/src/PickerInput/Selector/SingleSelector/index.tsx index 3b06ac6a5..0dbc82e8a 100644 --- a/src/PickerInput/Selector/SingleSelector/index.tsx +++ b/src/PickerInput/Selector/SingleSelector/index.tsx @@ -170,8 +170,8 @@ function SingleSelector( maxTagCount={maxTagCount} disabled={disabled} removeIcon={removeIcon} + placeholder={placeholder} /> - {!value.length && {placeholder}}