From df22ced1209775a14c1630e416f5f12d8e5f14fc Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Tue, 10 May 2022 01:28:56 -0700 Subject: [PATCH] fix text input --- src/ui/components/common/TextInput.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui/components/common/TextInput.tsx b/src/ui/components/common/TextInput.tsx index 2d5f8d1..039f02e 100644 --- a/src/ui/components/common/TextInput.tsx +++ b/src/ui/components/common/TextInput.tsx @@ -22,6 +22,12 @@ export default class TextInput extends React.Component { } static getDerivedStateFromProps(props: IProps, state: IState) { + if (!props.readOnly) { + return { + value: state.value + } + } + return { value: props.value || '' } }