From a0993d5e106be3ab9976e08894db64535e3f9ab3 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Thu, 5 May 2022 20:07:11 -0400 Subject: [PATCH] fix(striker-ui): show clear indicator when Select has value --- striker-ui/components/Select.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/striker-ui/components/Select.tsx b/striker-ui/components/Select.tsx index 8f98cce0..db652b90 100644 --- a/striker-ui/components/Select.tsx +++ b/striker-ui/components/Select.tsx @@ -29,14 +29,15 @@ const Select: FC = (selectProps) => { onClearIndicatorClick = SELECT_DEFAULT_PROPS.onClearIndicatorClick, ...muiSelectProps } = selectProps; - const { children, sx } = muiSelectProps; - const clearIndicator: JSX.Element | undefined = onClearIndicatorClick ? ( - - - - - - ) : undefined; + const { children, sx, value } = muiSelectProps; + const clearIndicator: JSX.Element | undefined = + String(value).length > 0 && onClearIndicatorClick ? ( + + + + + + ) : undefined; const combinedSx = { [`& .${muiSelectClasses.icon}`]: {