a11y: Enhance accessibility of form and interactive components using semantic HTML, ARIA attributes, and keyboard navigation.

This commit is contained in:
2026-02-25 16:17:40 -03:00
parent 59732f3706
commit 5b3fc800c7
6 changed files with 104 additions and 81 deletions
+3 -1
View File
@@ -13,9 +13,10 @@ interface ComboboxProps {
value: string;
onChange: (value: string) => void;
placeholder?: string;
id?: string;
}
export default function Combobox({ options, value, onChange, placeholder = "Search..." }: ComboboxProps) {
export default function Combobox({ options, value, onChange, placeholder = "Search...", id }: ComboboxProps) {
const [isOpen, setIsOpen] = useState(false);
const [search, setSearch] = useState("");
const containerRef = useRef<HTMLDivElement>(null);
@@ -39,6 +40,7 @@ export default function Combobox({ options, value, onChange, placeholder = "Sear
return (
<div className="relative" ref={containerRef}>
<button
id={id}
type="button"
onClick={() => setIsOpen(!isOpen)}
aria-haspopup="listbox"