From 7a1532fa2a8d10152cb947a1079da7111abdab96 Mon Sep 17 00:00:00 2001 From: Zoe Hayes Date: Wed, 24 Apr 2024 11:24:42 -0400 Subject: [PATCH] fix: make onChange prop of QueryItem InputText optional --- src/components/data-entry/QueryItem/TextInput.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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`