fix(striker-ui): expose required in SelectWithLabel

main
Tsu-ba-me 2 years ago
parent 230256a163
commit 3610c05d29
  1. 9
      striker-ui/components/SelectWithLabel.tsx
  2. 1
      striker-ui/types/SelectWithLabel.d.ts

@ -24,6 +24,7 @@ const SelectWithLabel: FC<SelectWithLabelProps> = ({
messageBoxProps = {},
name,
onChange,
required: isRequired,
selectProps: {
multiple: selectMultiple,
sx: selectSx,
@ -80,11 +81,15 @@ const SelectWithLabel: FC<SelectWithLabelProps> = ({
const labelElement = useMemo(
() =>
label && (
<OutlinedInputLabel htmlFor={selectId} {...inputLabelProps}>
<OutlinedInputLabel
htmlFor={selectId}
isNotifyRequired={isRequired}
{...inputLabelProps}
>
{label}
</OutlinedInputLabel>
),
[inputLabelProps, label, selectId],
[inputLabelProps, isRequired, label, selectId],
);
const menuItemElements = useMemo(
() =>

@ -20,6 +20,7 @@ type SelectWithLabelOptionalProps = {
>;
label?: string;
messageBoxProps?: Partial<import('../components/MessageBox').MessageBoxProps>;
required?: boolean;
selectProps?: Partial<SelectProps>;
};

Loading…
Cancel
Save