Skip to content

Commit

Permalink
fix: change type to string
Browse files Browse the repository at this point in the history
  • Loading branch information
Arucard89 committed Apr 7, 2024
1 parent 7b89a6a commit fb78910
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const SelectControl = React.forwardRef<HTMLButtonElement, ControlProps>((
if (!hasCounter) {
return null;
}
const count = Number(value?.length) || 0;
const count = String(value?.length ? value.length : 0);
const counterComponent = <SelectCounter count={count} size={size} disabled={disabled} />;
return renderCounter
? renderCounter(counterComponent, {count, size, disabled})
Expand Down
4 changes: 2 additions & 2 deletions src/components/Select/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export type SelectClearProps = SelectClearIconProps & {
};

export type SelectCounterProps = {
/** number of selected elements to show */
count: number;
/** amount of selected elements to show */
count: string;
/** size of the parent element */
size: SelectSize;
/** disabled state of the parent element*/
Expand Down

0 comments on commit fb78910

Please sign in to comment.