Files
community-rule/app/components/controls/SelectInput/SelectDropdown.tsx
T
adilallo 3a264ac2df Open the Share access menu above the dialog so both options can be picked.
The listbox was clipped inside the sheet, sat at 24px, and ignored arrow keys, so Anyone with the link could not be chosen by mouse or touch.
2026-11-21 11:41:05 -07:00

43 lines
934 B
TypeScript

"use client";
import { forwardRef, memo } from "react";
interface SelectDropdownProps extends React.HTMLAttributes<HTMLDivElement> {
className?: string;
children?: React.ReactNode;
ariaLabel: string;
}
const SelectDropdown = forwardRef<HTMLDivElement, SelectDropdownProps>(
({ className = "", children, ariaLabel, ...props }, ref) => {
const menuClasses = `
bg-[var(--color-surface-default-primary)]
border border-[var(--color-border-default-tertiary)]
rounded-[var(--radius-400)]
shadow-lg
p-[4px]
w-full
min-w-[200px]
${className}
`
.trim()
.replace(/\s+/g, " ");
return (
<div
ref={ref}
className={menuClasses}
role="listbox"
aria-label={ariaLabel}
{...props}
>
{children}
</div>
);
},
);
SelectDropdown.displayName = "SelectDropdown";
export default memo(SelectDropdown);