fix(striker-ui): passthrough value prop in OutlinedInputWithLabel

main
Tsu-ba-me 2 years ago
parent d1977a59c5
commit 7457649986
  1. 4
      striker-ui/components/OutlinedInputWithLabel.tsx

@ -16,6 +16,7 @@ type OutlinedInputWithLabelOptionalProps = {
inputProps?: Partial<OutlinedInputProps>; inputProps?: Partial<OutlinedInputProps>;
inputLabelProps?: Partial<OutlinedInputLabelProps>; inputLabelProps?: Partial<OutlinedInputLabelProps>;
messageBoxProps?: Partial<MessageBoxProps>; messageBoxProps?: Partial<MessageBoxProps>;
value?: OutlinedInputProps['value'];
}; };
type OutlinedInputWithLabelProps = { type OutlinedInputWithLabelProps = {
@ -29,6 +30,7 @@ const OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS: Required<OutlinedInputWithLabelOp
inputProps: {}, inputProps: {},
inputLabelProps: {}, inputLabelProps: {},
messageBoxProps: {}, messageBoxProps: {},
value: '',
}; };
const OutlinedInputWithLabel = ({ const OutlinedInputWithLabel = ({
@ -38,6 +40,7 @@ const OutlinedInputWithLabel = ({
inputLabelProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.inputLabelProps, inputLabelProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.inputLabelProps,
label, label,
messageBoxProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.messageBoxProps, messageBoxProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.messageBoxProps,
value,
}: OutlinedInputWithLabelProps): JSX.Element => ( }: OutlinedInputWithLabelProps): JSX.Element => (
<MUIFormControl {...formControlProps}> <MUIFormControl {...formControlProps}>
<OutlinedInputLabel {...{ htmlFor: id, ...inputLabelProps }}> <OutlinedInputLabel {...{ htmlFor: id, ...inputLabelProps }}>
@ -48,6 +51,7 @@ const OutlinedInputWithLabel = ({
fullWidth: formControlProps.fullWidth, fullWidth: formControlProps.fullWidth,
id, id,
label, label,
value,
...inputProps, ...inputProps,
}} }}
/> />

Loading…
Cancel
Save