We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab79531 commit 63ed492Copy full SHA for 63ed492
course-matrix/frontend/src/pages/TimetableBuilder/CreateCustomSetting.tsx
@@ -166,8 +166,15 @@ const CreateCustomSetting = ({
166
<FormLabel>Restriction Type</FormLabel>
167
<FormControl>
168
<Select
169
- onValueChange={field.onChange}
170
- value={field.value}
+ onValueChange={(value) => {
+ field.onChange(value);
171
+ // Reset values when toggle type
172
+ restrictionForm.setValue("days", []);
173
+ restrictionForm.setValue("startTime", undefined);
174
+ restrictionForm.setValue("endTime", undefined);
175
+ restrictionForm.setValue("maxGap", undefined);
176
+ restrictionForm.setValue("numDays", undefined);
177
+ }}
178
defaultValue={""}
179
>
180
<SelectTrigger className="w-[320px]">
0 commit comments