Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix cron job form does not focus invalid inputs (#45114)

Gildas Garcia5d5ac18f3c38
diff --git a/apps/studio/components/interfaces/Integrations/CronJobs/CreateCronJobSheet/CreateCronJobSheet.tsx b/apps/studio/components/interfaces/Integrations/CronJobs/CreateCronJobSheet/CreateCronJobSheet.tsx
index 16228995cce..1ff314b81d7 100644
--- a/apps/studio/components/interfaces/Integrations/CronJobs/CreateCronJobSheet/CreateCronJobSheet.tsx
+++ b/apps/studio/components/interfaces/Integrations/CronJobs/CreateCronJobSheet/CreateCronJobSheet.tsx
@@ -176,10 +176,14 @@ export const CreateCronJobSheet = ({ open, selectedCronJob, onClose }: CreateCro
const nameExists = !!checkExistingJob
if (nameExists) {
- return form.setError('name', {
- type: 'manual',
- message: 'A cron job with this name already exists',
- })
+ return form.setError(
+ 'name',
+ {
+ type: 'manual',
+ message: 'A cron job with this name already exists',
+ },
+ { shouldFocus: true }
+ )
}
} catch (error: any) {
toast.error(`Failed to validate cron job name: ${error.message}`)