Skip to content

Commit

Permalink
fix: dom order (#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Apr 16, 2024
1 parent baba2fb commit f4ada6b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/PickerInput/Selector/SingleSelector/MultipleDates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@ export interface MultipleDatesProps<DateType extends object = any>
removeIcon?: React.ReactNode;
formatDate: (date: DateType) => string;
disabled?: boolean;
placeholder?: React.ReactNode;
}

export default function MultipleDates<DateType extends object = any>(
props: MultipleDatesProps<DateType>,
) {
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`;
Expand Down Expand Up @@ -76,6 +86,7 @@ export default function MultipleDates<DateType extends object = any>(
itemKey={(date) => formatDate(date)}
maxCount={maxTagCount}
/>
{!value.length && <span className={`${prefixCls}-selection-placeholder`}>{placeholder}</span>}
</div>
);
}
2 changes: 1 addition & 1 deletion src/PickerInput/Selector/SingleSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ function SingleSelector<DateType extends object = any>(
maxTagCount={maxTagCount}
disabled={disabled}
removeIcon={removeIcon}
placeholder={placeholder}
/>
{!value.length && <span className={`${prefixCls}-selection-placeholder`}>{placeholder}</span>}
<input
className={`${prefixCls}-multiple-input`}
value={value.map(getText).join(',')}
Expand Down

0 comments on commit f4ada6b

Please sign in to comment.