Skip to content

Commit ab10d5d

Browse files
committed
fix: add accessible id to Combobox
1 parent e6f6388 commit ab10d5d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

site/src/components/Combobox/Combobox.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ interface ComboboxProps {
3434
onInputChange?: (value: string) => void;
3535
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
3636
onSelect: (value: string) => void;
37+
id?: string;
3738
}
3839

3940
type ComboboxOption = {
@@ -53,6 +54,7 @@ export const Combobox: FC<ComboboxProps> = ({
5354
onInputChange,
5455
onKeyDown,
5556
onSelect,
57+
id,
5658
}) => {
5759
const [managedOpen, setManagedOpen] = useState(false);
5860
const [managedInputValue, setManagedInputValue] = useState("");
@@ -78,6 +80,7 @@ export const Combobox: FC<ComboboxProps> = ({
7880
<Popover open={isOpen} onOpenChange={handleOpenChange}>
7981
<PopoverTrigger asChild>
8082
<Button
83+
id={id}
8184
variant="outline"
8285
aria-expanded={isOpen}
8386
className="w-full justify-between group"

site/src/modules/workspaces/DynamicParameter/DynamicParameter.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ const ParameterField: FC<ParameterFieldProps> = ({
453453
case "dropdown": {
454454
return (
455455
<Combobox
456+
id={id}
456457
value={value ?? ""}
457458
onSelect={(value) => onChange(value)}
458459
options={parameter.options.map((option) => ({

0 commit comments

Comments
 (0)