Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a6271ca

Browse files
committed
Remove helper text when disabled
1 parent 0577ea9 commit a6271ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

site/src/components/WorkspaceScheduleForm/WorkspaceScheduleForm.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ export const WorkspaceScheduleForm: FC<WorkspaceScheduleFormProps> = ({
239239
label={Language.startSwitch}
240240
/>
241241
<TextField
242-
{...formHelpers("startTime", Language.startTimeHelperText)}
242+
{...formHelpers("startTime")}
243+
helperText={form.values.autoStartEnabled ? Language.startTimeHelperText : ""}
243244
disabled={isLoading || !form.values.autoStartEnabled}
244245
InputLabelProps={{
245246
shrink: true,
@@ -307,7 +308,8 @@ export const WorkspaceScheduleForm: FC<WorkspaceScheduleFormProps> = ({
307308
label={Language.stopSwitch}
308309
/>
309310
<TextField
310-
{...formHelpers("ttl", ttlShutdownAt(form.values.ttl), "ttl_ms")}
311+
{...formHelpers("ttl", "", "ttl_ms")}
312+
helperText={form.values.autoStopEnabled ? ttlShutdownAt(form.values.ttl) : ""}
311313
disabled={isLoading || !form.values.autoStopEnabled}
312314
inputProps={{ min: 0, step: 1 }}
313315
label={Language.ttlLabel}

0 commit comments

Comments
 (0)