Files
community-rule/app/components/controls/SelectOption/SelectOption.view.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

58 lines
1.3 KiB
TypeScript

import { forwardRef } from "react";
import type { SelectOptionViewProps } from "./SelectOption.types";
export const SelectOptionView = forwardRef<
HTMLDivElement,
SelectOptionViewProps
>(
(
{
children,
selected,
disabled,
itemClasses,
optionId,
handleClick,
handleKeyDown,
...props
},
ref,
) => {
return (
<div
ref={ref}
id={optionId}
className={itemClasses}
role="option"
tabIndex={-1}
aria-selected={selected}
aria-disabled={disabled}
onClick={handleClick}
onKeyDown={handleKeyDown}
{...props}
>
<div className="flex items-center gap-[8px]">
{selected && (
<svg
className="w-4 h-4 text-[var(--color-content-default-brand-primary)]"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M5 13l4 4L19 7"
/>
</svg>
)}
<span>{children}</span>
</div>
</div>
);
},
);
SelectOptionView.displayName = "SelectOptionView";