diff --git a/apps/console/src/components/form/AuditSelectField.tsx b/apps/console/src/components/form/AuditSelectField.tsx index c7540effd..bcfe22b5a 100644 --- a/apps/console/src/components/form/AuditSelectField.tsx +++ b/apps/console/src/components/form/AuditSelectField.tsx @@ -67,6 +67,8 @@ function AuditSelectWithQuery( const data = useLazyLoadQuery(auditsQuery, { organizationId }, { fetchPolicy: "network-only" }); const audits = data?.organization?.audits?.edges?.map((edge) => edge.node).filter((node) => node !== null) ?? []; + const NONE_VALUE = "__NONE__"; + return ( ( id={name} variant="editor" placeholder={__("Select an audit")} - onValueChange={field.onChange} + onValueChange={(value) => field.onChange(value === NONE_VALUE ? "" : value)} key={audits?.length.toString() ?? "0"} {...field} className="w-full" - value={field.value ?? ""} + value={field.value || NONE_VALUE} > + {audits?.map((audit) => (