From be0fd32099615650783eafb894ee713a21cdd534 Mon Sep 17 00:00:00 2001 From: Keane Chan Date: Thu, 6 Oct 2022 00:03:59 +0800 Subject: [PATCH] [feat][resumes] make value in Select optional --- packages/ui/src/Select/Select.tsx | 1 + packages/ui/src/TextInput/TextInput.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/packages/ui/src/Select/Select.tsx b/packages/ui/src/Select/Select.tsx index d7817274..294ae34d 100644 --- a/packages/ui/src/Select/Select.tsx +++ b/packages/ui/src/Select/Select.tsx @@ -35,6 +35,7 @@ function Select( label, isLabelHidden, options, + value, onChange, ...props }: Props, diff --git a/packages/ui/src/TextInput/TextInput.tsx b/packages/ui/src/TextInput/TextInput.tsx index cf525b20..ebb08328 100644 --- a/packages/ui/src/TextInput/TextInput.tsx +++ b/packages/ui/src/TextInput/TextInput.tsx @@ -34,6 +34,7 @@ type Props = Readonly<{ onBlur?: (event: FocusEvent) => void; onChange?: (value: string, event: ChangeEvent) => void; startIcon?: React.ComponentType>; + value?: string; }> & Readonly; @@ -57,6 +58,7 @@ function TextInput( label, startIcon: StartIcon, type = 'text', + value, onChange, ...props }: Props, @@ -100,6 +102,7 @@ function TextInput( disabled={disabled} id={id} type={type} + value={value != null ? value : undefined} onChange={(event) => { if (!onChange) { return;