Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix: Improve disabled Select

Daniel Hougaard1f68730aa3ae
diff --git a/frontend/src/components/v2/Select/Select.tsx b/frontend/src/components/v2/Select/Select.tsx
index 2a76be2abf..12a9094e03 100644
--- a/frontend/src/components/v2/Select/Select.tsx
+++ b/frontend/src/components/v2/Select/Select.tsx
@@ -41,18 +41,22 @@ export const Select = forwardRef<HTMLButtonElement, SelectProps>(
ref={ref}
className={twMerge(
`inline-flex items-center justify-between rounded-md
- bg-mineshaft-900 px-3 py-2 font-inter text-sm font-normal text-bunker-200 outline-none data-[placeholder]:text-mineshaft-200 focus:bg-mineshaft-700/80`,
- className
+ bg-mineshaft-900 px-3 py-2 font-inter text-sm font-normal text-bunker-200 outline-none focus:bg-mineshaft-700/80 data-[placeholder]:text-mineshaft-200`,
+ className,
+ isDisabled && "cursor-not-allowed opacity-50"
)}
>
<SelectPrimitive.Value placeholder={placeholder}>
{props.icon ? <FontAwesomeIcon icon={props.icon} /> : placeholder}
</SelectPrimitive.Value>
- {!isDisabled && (
- <SelectPrimitive.Icon className="ml-3">
- <FontAwesomeIcon icon={faCaretDown} size="sm" />
- </SelectPrimitive.Icon>
- )}
+
+ <SelectPrimitive.Icon className="ml-3">
+ <FontAwesomeIcon
+ icon={faCaretDown}
+ size="sm"
+ className={twMerge(isDisabled && "opacity-30")}
+ />
+ </SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
<SelectPrimitive.Portal>
<SelectPrimitive.Content