/* eslint-disable jsx-a11y/mouse-events-have-key-events */ /** biome-ignore-all lint/a11y/useKeyWithMouseEvents: We know what we are doing */ import React from "react"; import { cl } from "../../../helpers"; export interface ListboxOptionsProps extends Omit< React.HTMLAttributes, "role" | "tabIndex" | "onMouseOver" > { children: React.ReactNode; setVirtuallyFocusedOptionId: (value: string) => void; } function ListboxOptions({ children, setVirtuallyFocusedOptionId, ...rest }: ListboxOptionsProps) { return (
{ const target = event.target as HTMLElement; const optionEl: HTMLElement | null = target.closest('[role="option"]'); if (optionEl) { setVirtuallyFocusedOptionId(optionEl?.dataset.id || ""); } }} > {children}
); } export { ListboxOptions };