From 3610c05d2930d123d6a9b11415334a3bdae7910b Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Thu, 2 Mar 2023 16:25:58 -0500 Subject: [PATCH] fix(striker-ui): expose required in SelectWithLabel --- striker-ui/components/SelectWithLabel.tsx | 9 +++++++-- striker-ui/types/SelectWithLabel.d.ts | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/striker-ui/components/SelectWithLabel.tsx b/striker-ui/components/SelectWithLabel.tsx index 00ed6e02..8a7d63e2 100644 --- a/striker-ui/components/SelectWithLabel.tsx +++ b/striker-ui/components/SelectWithLabel.tsx @@ -24,6 +24,7 @@ const SelectWithLabel: FC = ({ messageBoxProps = {}, name, onChange, + required: isRequired, selectProps: { multiple: selectMultiple, sx: selectSx, @@ -80,11 +81,15 @@ const SelectWithLabel: FC = ({ const labelElement = useMemo( () => label && ( - + {label} ), - [inputLabelProps, label, selectId], + [inputLabelProps, isRequired, label, selectId], ); const menuItemElements = useMemo( () => diff --git a/striker-ui/types/SelectWithLabel.d.ts b/striker-ui/types/SelectWithLabel.d.ts index 384e48ff..d799a1b5 100644 --- a/striker-ui/types/SelectWithLabel.d.ts +++ b/striker-ui/types/SelectWithLabel.d.ts @@ -20,6 +20,7 @@ type SelectWithLabelOptionalProps = { >; label?: string; messageBoxProps?: Partial; + required?: boolean; selectProps?: Partial; };