Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

feat: improve usability on input-select

flooorianflo8c039435151e
diff --git a/packages/ui/src/input-select.tsx b/packages/ui/src/input-select.tsx
index 82e7768266..e279fc691a 100644
--- a/packages/ui/src/input-select.tsx
+++ b/packages/ui/src/input-select.tsx
@@ -152,7 +152,7 @@ export function InputSelect({
<Command ref={commandRef} className="relative" loop>
<div
className={cn(
- "group relative min-w-[136px] rounded-md border border-gray-300 bg-white px-1 focus-within:border-gray-500 focus-within:ring-1 focus-within:ring-gray-500",
+ "group relative min-w-[140px] rounded-md border border-gray-300 bg-white px-1 focus-within:border-gray-500 focus-within:ring-1 focus-within:ring-gray-500",
className,
)}
>
@@ -249,7 +249,10 @@ export function InputSelect({
className,
)}
>
- <div className="absolute inset-y-0 left-0 flex items-center justify-center pl-3 text-gray-400">
+ <div
+ onClick={() => setOpenCommandList((prev) => !prev)}
+ className="absolute inset-y-0 left-0 flex cursor-pointer items-center justify-center pl-3 text-gray-400"
+ >
{selectedItem && selectedItem.image ? (
<img
src={selectedItem.image}
@@ -273,7 +276,12 @@ export function InputSelect({
<X className="h-7 w-7 pr-3 text-gray-400" />
</button>
) : (
- <ChevronDown className="absolute inset-y-0 right-0 my-auto h-7 w-7 pr-3 text-gray-400 transition-all" />
+ <ChevronDown
+ onClick={() => setOpenCommandList((prev) => !prev)}
+ className={`absolute inset-y-0 right-0 my-auto mr-3 h-4 w-4 cursor-pointer text-gray-400 transition-all ${
+ openCommandList && "rotate-180"
+ }`}
+ />
)}
</div>
</div>