Skip to content

Commit

Permalink
fix: make onChange prop of QueryItem InputText optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoeAstra committed Apr 24, 2024
1 parent 9df86b2 commit 7a1532f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/data-entry/QueryItem/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,7 +14,8 @@ export const TextInput = (props: ITextInputProps) => {
const isErrorStatus = props.errorMessage && !props.disabled

const _onChange = (e: ChangeEvent<HTMLInputElement>) => {
props.onChange(e.target.value)
if(props.onChange)
props.onChange(e.target.value)
}

let inputClasses = `query-item query-item--input-text`
Expand Down

0 comments on commit 7a1532f

Please sign in to comment.