Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Keep long space names inside the space dropdown (#3354)

Luke Vella7d77c27ee883
diff --git a/apps/web/src/features/space/components/space-dropdown.tsx b/apps/web/src/features/space/components/space-dropdown.tsx
index ca85e18b6..8c4cf3cb4 100644
--- a/apps/web/src/features/space/components/space-dropdown.tsx
+++ b/apps/web/src/features/space/components/space-dropdown.tsx
@@ -86,10 +86,7 @@ export function SpaceDropdown({
</div>
<ChevronsUpDownIcon className="text-muted-foreground" />
</DropdownMenuTrigger>
- <DropdownMenuContent
- className="min-w-[var(--anchor-width)]"
- align="start"
- >
+ <DropdownMenuContent className="w-(--anchor-width)" align="start">
<DropdownMenuLabel>
<Trans i18nKey="spaces" defaults="Spaces" />
</DropdownMenuLabel>
@@ -108,7 +105,9 @@ export function SpaceDropdown({
className="flex items-center gap-2"
>
<SpaceIcon size="sm" src={space.image} name={space.name} />
- <span>{space.name}</span>
+ <span className="min-w-0 truncate" title={space.name}>
+ {space.name}
+ </span>
</DropdownMenuRadioItem>
))}
</DropdownMenuRadioGroup>
diff --git a/packages/ui/src/dropdown-menu.tsx b/packages/ui/src/dropdown-menu.tsx
index ac040e708..5437e5b65 100644
--- a/packages/ui/src/dropdown-menu.tsx
+++ b/packages/ui/src/dropdown-menu.tsx
@@ -103,6 +103,7 @@ function DropdownMenuRadioItem({
data-slot="dropdown-menu-radio-item"
className={cn(
dropdownMenuItemVariants({ variant: "default" }),
+ "pr-8",
className,
)}
closeOnClick