Skip to content

Commit 60f3eae

Browse files
committed
Select style fix
1 parent fdb91f3 commit 60f3eae

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

packages/ui/src/components/Select.tsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -115,31 +115,28 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
115115
error ? "text-red-500 dark:text-red-600" : "focus:text-text-primary dark:focus:text-text-primary-dark",
116116
error ? "border border-red-500 dark:border-red-600" : "",
117117
disabled ? "text-slate-600 dark:text-slate-400" : "text-slate-800 dark:text-white",
118-
"relative flex items-center",
118+
"relative flex flex-row items-center",
119119
inputClassName
120120
)}>
121-
<SelectPrimitive.Value
122-
onClick={(e) => {
123-
e.preventDefault();
124-
e.stopPropagation();
125-
}}
126-
placeholder={placeholder}
127-
asChild
128-
className={"w-full"}>
129-
<div
121+
122+
<SelectPrimitive.Value
123+
onClick={(e) => {
124+
e.preventDefault();
125+
e.stopPropagation();
126+
}}
130127
ref={ref}
131128
className={cls(
132129
"flex-grow w-full max-w-full flex flex-row gap-2 items-center",
133130
"overflow-visible",
134131
size === "small" ? "h-[42px]" : "h-[64px]"
135132
)}
136-
>
133+
placeholder={placeholder}>
137134
{hasValue && value && renderValue ? renderValue(value) : placeholder}
138135
{hasValue && !renderValue && value}
139-
</div>
140-
</SelectPrimitive.Value>
141-
<SelectPrimitive.Icon className={cls("px-2 h-full flex items-center")}>
142-
<ExpandMoreIcon size={"small"} className={cls("transition", open ? "rotate-180" : "")}/>
136+
</SelectPrimitive.Value>
137+
138+
<SelectPrimitive.Icon asChild>
139+
<ExpandMoreIcon size={"small"} className={cls("absolute right-2 px-2 top-5 transition", open ? "rotate-180" : "")}/>
143140
</SelectPrimitive.Icon>
144141
</SelectPrimitive.Trigger>
145142
{endAdornment && (
@@ -158,7 +155,7 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
158155
className={cls(focusedDisabled, "z-50 relative overflow-hidden border bg-white dark:bg-gray-900 p-2 rounded-lg", defaultBorderMixin)}>
159156
<SelectPrimitive.Viewport className={"p-1"}
160157
style={{ maxHeight: "var(--radix-select-content-available-height)" }}>
161-
{children}
158+
{children}
162159
</SelectPrimitive.Viewport>
163160
</SelectPrimitive.Content>
164161
</SelectPrimitive.Portal>

0 commit comments

Comments
 (0)