Skip to content

Commit 7f4e8e1

Browse files
authored
trigger on change for dropdown & warn on empty ask ai prompt (#11029)
1 parent 7e7544b commit 7f4e8e1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

teachertool/src/components/CriteriaInstanceDisplay.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ const InlineInputSegment: React.FC<InlineInputSegmentProps> = ({
5353
return;
5454
}
5555

56+
if (!initialValue) {
57+
setErrorMessage(Strings.ValueRequired);
58+
return;
59+
}
60+
5661
// We still allow some invalid values to be set on the parameter so the user can see what they typed
5762
// and the associated error.
5863
// Without this, we risk erroring too soon (i.e. typing in first digit of number with min > 10),
@@ -88,6 +93,7 @@ const InlineInputSegment: React.FC<InlineInputSegmentProps> = ({
8893
icon={errorMessage ? "fas fa-exclamation-triangle" : undefined}
8994
initialValue={initialValue}
9095
onChange={onChange}
96+
onOptionSelected={onChange}
9197
preserveValueOnBlur={true}
9298
placeholder={numeric ? "0" : param.name}
9399
title={tooltip}

0 commit comments

Comments
 (0)