Skip to content

Commit 9926408

Browse files
fix(app): make invite modal manual rows scrollable so action buttons stay visible (#3510)
Co-authored-by: chasprowebdev <chasgarciaprowebdev@gmail.com> Co-authored-by: chasprowebdev <70908289+chasprowebdev@users.noreply.github.com>
1 parent 3f9e1cf commit 9926408

1 file changed

Lines changed: 51 additions & 49 deletions

File tree

‎apps/app/src/app/(app)/[orgId]/people/all/components/InviteMembersModal.tsx‎

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -455,56 +455,58 @@ export function InviteMembersModal({
455455
</TabsList>
456456

457457
<TabsContent value="manual" className="space-y-4 pt-4">
458-
{fields.map((item, index) => (
459-
<div key={item.id} className="flex items-start gap-2">
460-
<FormField
461-
control={form.control}
462-
name={`manualInvites.${index}.email`}
463-
render={({ field }) => (
464-
<FormItem className="flex-1">
465-
{index === 0 && <FormLabel>{'Email'}</FormLabel>}
466-
<FormControl>
467-
<Input
468-
className="h-10"
469-
placeholder={'Enter email address'}
470-
{...field}
471-
value={field.value || ''}
458+
<div className="max-h-[280px] space-y-3 overflow-y-auto px-1">
459+
{fields.map((item, index) => (
460+
<div key={item.id} className="flex items-start gap-2">
461+
<FormField
462+
control={form.control}
463+
name={`manualInvites.${index}.email`}
464+
render={({ field }) => (
465+
<FormItem className="flex-1">
466+
{index === 0 && <FormLabel>{'Email'}</FormLabel>}
467+
<FormControl>
468+
<Input
469+
className="h-10"
470+
placeholder={'Enter email address'}
471+
{...field}
472+
value={field.value || ''}
473+
/>
474+
</FormControl>
475+
<FormMessage />
476+
</FormItem>
477+
)}
478+
/>
479+
<Controller
480+
control={form.control}
481+
name={`manualInvites.${index}.roles`}
482+
render={({ field: { onChange, value }, fieldState: { error } }) => (
483+
<FormItem className="w-[200px]">
484+
{index === 0 && <FormLabel>{'Role'}</FormLabel>}
485+
<MultiRoleCombobox
486+
selectedRoles={value || []}
487+
onSelectedRolesChange={onChange}
488+
allowedRoles={normalizedAllowedRoles}
489+
customRoles={customRoles}
490+
placeholder={'Select a role'}
472491
/>
473-
</FormControl>
474-
<FormMessage />
475-
</FormItem>
476-
)}
477-
/>
478-
<Controller
479-
control={form.control}
480-
name={`manualInvites.${index}.roles`}
481-
render={({ field: { onChange, value }, fieldState: { error } }) => (
482-
<FormItem className="w-[200px]">
483-
{index === 0 && <FormLabel>{'Role'}</FormLabel>}
484-
<MultiRoleCombobox
485-
selectedRoles={value || []}
486-
onSelectedRolesChange={onChange}
487-
allowedRoles={normalizedAllowedRoles}
488-
customRoles={customRoles}
489-
placeholder={'Select a role'}
490-
/>
491-
<FormMessage>{error?.message}</FormMessage>
492-
</FormItem>
493-
)}
494-
/>
495-
<Button
496-
type="button"
497-
variant="ghost"
498-
size="icon"
499-
onClick={() => fields.length > 1 && remove(index)}
500-
disabled={fields.length <= 1}
501-
className={`mt-${index === 0 ? '6' : '0'} self-center ${fields.length <= 1 ? 'cursor-not-allowed opacity-50' : ''}`}
502-
aria-label="Remove invite"
503-
>
504-
<Trash2 className="h-4 w-4" />
505-
</Button>
506-
</div>
507-
))}
492+
<FormMessage>{error?.message}</FormMessage>
493+
</FormItem>
494+
)}
495+
/>
496+
<Button
497+
type="button"
498+
variant="ghost"
499+
size="icon"
500+
onClick={() => fields.length > 1 && remove(index)}
501+
disabled={fields.length <= 1}
502+
className={`mt-${index === 0 ? '6' : '0'} self-center ${fields.length <= 1 ? 'cursor-not-allowed opacity-50' : ''}`}
503+
aria-label="Remove invite"
504+
>
505+
<Trash2 className="h-4 w-4" />
506+
</Button>
507+
</div>
508+
))}
509+
</div>
508510
<Button
509511
type="button"
510512
variant="outline"

0 commit comments

Comments
 (0)