[feat][resumes] make value in Select optional

pull/309/head
Keane Chan 3 years ago
parent 4d6413a56b
commit be0fd32099
No known key found for this signature in database
GPG Key ID: 32718398E1E9F87C

@ -35,6 +35,7 @@ function Select<T>(
label, label,
isLabelHidden, isLabelHidden,
options, options,
value,
onChange, onChange,
...props ...props
}: Props<T>, }: Props<T>,

@ -34,6 +34,7 @@ type Props = Readonly<{
onBlur?: (event: FocusEvent<HTMLInputElement>) => void; onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void; onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
startIcon?: React.ComponentType<React.ComponentProps<'svg'>>; startIcon?: React.ComponentType<React.ComponentProps<'svg'>>;
value?: string;
}> & }> &
Readonly<Attributes>; Readonly<Attributes>;
@ -57,6 +58,7 @@ function TextInput(
label, label,
startIcon: StartIcon, startIcon: StartIcon,
type = 'text', type = 'text',
value,
onChange, onChange,
...props ...props
}: Props, }: Props,
@ -100,6 +102,7 @@ function TextInput(
disabled={disabled} disabled={disabled}
id={id} id={id}
type={type} type={type}
value={value != null ? value : undefined}
onChange={(event) => { onChange={(event) => {
if (!onChange) { if (!onChange) {
return; return;

Loading…
Cancel
Save