Skip to content

Commit

Permalink
don't validate when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercactapus committed Nov 20, 2023
1 parent 541ba16 commit 42ff6c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/src/app/util/ISOPickers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function ISOPicker(props: ISOPickerProps): JSX.Element {
)

function getSoftValidationError(value: string): string {
if (props.disabled) return ''
let dt: DateTime
try {
dt = DateTime.fromISO(value, { zone })
Expand Down Expand Up @@ -95,7 +96,7 @@ function ISOPicker(props: ISOPickerProps): JSX.Element {
useEffect(
() =>
setValidationError(props.name || '', getSoftValidationError(inputValue)),
[inputValue, valueAsDT, props.name, softMin, softMax],
[inputValue, props.disabled, valueAsDT, props.name, softMin, softMax],
)

useEffect(() => {
Expand Down

0 comments on commit 42ff6c6

Please sign in to comment.