From fb78910e310747666144958cefc8542fc18ca8cd Mon Sep 17 00:00:00 2001 From: Kirill Revenkov Date: Sun, 7 Apr 2024 22:56:22 +0300 Subject: [PATCH] fix: change type to string --- .../Select/components/SelectControl/SelectControl.tsx | 2 +- src/components/Select/types.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Select/components/SelectControl/SelectControl.tsx b/src/components/Select/components/SelectControl/SelectControl.tsx index 09d361cf9b..ef01343163 100644 --- a/src/components/Select/components/SelectControl/SelectControl.tsx +++ b/src/components/Select/components/SelectControl/SelectControl.tsx @@ -115,7 +115,7 @@ export const SelectControl = React.forwardRef(( if (!hasCounter) { return null; } - const count = Number(value?.length) || 0; + const count = String(value?.length ? value.length : 0); const counterComponent = ; return renderCounter ? renderCounter(counterComponent, {count, size, disabled}) diff --git a/src/components/Select/types.ts b/src/components/Select/types.ts index 05af9e803f..8b437baa48 100644 --- a/src/components/Select/types.ts +++ b/src/components/Select/types.ts @@ -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*/