Skip to content

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

Pass the default value to select lists (#11342)

Terry Sutton5403751c4dc1
diff --git a/packages/ui/src/components/Select/Select.tsx b/packages/ui/src/components/Select/Select.tsx
index d51e9e87c8b..365a0c1fb0c 100644
--- a/packages/ui/src/components/Select/Select.tsx
+++ b/packages/ui/src/components/Select/Select.tsx
@@ -73,7 +73,6 @@ function Select({
useFormContext()
if (values && !value) value = values[id]
-
function handleBlurEvent(e: React.FocusEvent<HTMLSelectElement>) {
if (handleBlur) handleBlur(e)
if (onBlur) onBlur(e)
@@ -126,6 +125,7 @@ function Select({
<select
id={id}
name={name}
+ defaultValue={defaultValue}
autoComplete={autoComplete}
autoFocus={autofocus}
className={classes.join(' ')}
diff --git a/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx b/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx
index 091496b3238..1d5e2c86b1a 100644
--- a/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx
+++ b/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx
@@ -147,6 +147,7 @@ const InviteMemberButton: FC<Props> = ({ user, members = [], roles = [], rolesAd
<div className="space-y-2">
{roles && (
<Select
+ defaultValue={roles.find((role) => role.name === 'Developer')?.id}
name="role"
label="Member role"
error={