Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/Selector/MultipleSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const SelectSelector: React.FC<SelectorProps> = (props) => {
// ===================== Render ======================
// >>> Render Selector Node. Includes Item & Rest
function defaultRenderSelector(
title: React.ReactNode,
content: React.ReactNode,
itemDisabled: boolean,
closable?: boolean,
Expand All @@ -103,9 +104,7 @@ const SelectSelector: React.FC<SelectorProps> = (props) => {
[`${selectionPrefixCls}-item-disabled`]: itemDisabled,
})}
title={
typeof content === 'string' || typeof content === 'number'
? content.toString()
: undefined
typeof title === 'string' || typeof title === 'number' ? title.toString() : undefined
}
>
<span className={`${selectionPrefixCls}-item-content`}>{content}</span>
Expand Down Expand Up @@ -170,7 +169,7 @@ const SelectSelector: React.FC<SelectorProps> = (props) => {

return typeof tagRender === 'function'
? customizeRenderSelector(value, displayLabel, itemDisabled, closable, onClose)
: defaultRenderSelector(displayLabel, itemDisabled, closable, onClose);
: defaultRenderSelector(label, displayLabel, itemDisabled, closable, onClose);
}

function renderRest(omittedValues: DisplayLabelValueType[]) {
Expand All @@ -179,7 +178,7 @@ const SelectSelector: React.FC<SelectorProps> = (props) => {
? maxTagPlaceholder(omittedValues)
: maxTagPlaceholder;

return defaultRenderSelector(content, false);
return defaultRenderSelector(content, content, false);
}

// >>> Input Node
Expand Down
4 changes: 2 additions & 2 deletions tests/__snapshots__/Multiple.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ exports[`Select.Multiple render truncates values by maxTagTextLength 1`] = `
>
<span
class="rc-select-selection-item"
title="On..."
title="One"
>
<span
class="rc-select-selection-item-content"
Expand All @@ -327,7 +327,7 @@ exports[`Select.Multiple render truncates values by maxTagTextLength 1`] = `
>
<span
class="rc-select-selection-item"
title="Tw..."
title="Two"
>
<span
class="rc-select-selection-item-content"
Expand Down
4 changes: 2 additions & 2 deletions tests/__snapshots__/Tags.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ exports[`Select.Tags render truncates values by maxTagTextLength 1`] = `
>
<span
class="rc-select-selection-item"
title="On..."
title="One"
>
<span
class="rc-select-selection-item-content"
Expand All @@ -546,7 +546,7 @@ exports[`Select.Tags render truncates values by maxTagTextLength 1`] = `
>
<span
class="rc-select-selection-item"
title="Tw..."
title="Two"
>
<span
class="rc-select-selection-item-content"
Expand Down