Skip to content

Commit

Permalink
🐛 fix(select): fix scroll snap on selects
Browse files Browse the repository at this point in the history
  • Loading branch information
thrownullexception committed Aug 11, 2024
1 parent 5a48dee commit 6a9ab19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/frontend/components/app/form/input/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ export function FormSearch({
onChange(e.target.value.toLowerCase());
setValue(e.target.value);
}}
onBlur={(e) => {
if (["listbox", "option"].includes(e.relatedTarget?.role)) {
e.target.focus();
}
}}
// onBlur={(e) => {
// if (["listbox", "option"].includes(e.relatedTarget?.role)) {
// e.target.focus();
// }
// }}
placeholder={_(msg`Search`)}
ref={inputRef}
/>
Expand Down
5 changes: 3 additions & 2 deletions src/frontend/components/ui/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ const SelectItem = React.forwardRef<
<SelectPrimitive.Item
ref={ref}
className={cn(
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none hover:bg-hover data-[disabled]:pointer-events-none data-[highlighted]:bg-hover data-[disabled]:text-muted",
{ "!bg-primary-alpha text-primary-alpha-text": selected },
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none hover:bg-hover data-[disabled]:pointer-events-none data-[disabled]:text-muted",
{ "bg-hover": selected },
className
)}
{...props}
Expand Down Expand Up @@ -160,6 +160,7 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;

export interface ISelectProps {
options: ISelectData[];
// options: ISelectData[] | Record<string, ISelectData[]>;
onChange: (value: string) => void;
value: string;
className?: string;
Expand Down

0 comments on commit 6a9ab19

Please sign in to comment.