diff --git a/src/components/data-entry/QueryItem/TextInput.tsx b/src/components/data-entry/QueryItem/TextInput.tsx index 72d4afab2..2e0a6cd46 100644 --- a/src/components/data-entry/QueryItem/TextInput.tsx +++ b/src/components/data-entry/QueryItem/TextInput.tsx @@ -4,7 +4,7 @@ import { Input } from 'src/components' import { Typography } from 'src/components/general/Typography/Typography' interface ITextInputProps { - onChange: (value: string) => void + onChange?: (value: string) => void value?: string disabled?: boolean errorMessage?: string @@ -14,7 +14,8 @@ export const TextInput = (props: ITextInputProps) => { const isErrorStatus = props.errorMessage && !props.disabled const _onChange = (e: ChangeEvent) => { - props.onChange(e.target.value) + if(props.onChange) + props.onChange(e.target.value) } let inputClasses = `query-item query-item--input-text`