Skip to content

Commit

Permalink
fix: Updates Combobox (Searchable list) to pre-populate if a value ex…
Browse files Browse the repository at this point in the history
…ists (#4779)

* Updates combobox to prepopulate if a value

* Fixes escape key behavior

* Updates comment

* Updates combobox to use dropshift initial value
  • Loading branch information
thiessenp-cds authored Dec 5, 2024
1 parent cc9ca20 commit 4531181
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/clientComponents/forms/Combobox/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const Combobox = (props: ComboboxProps): React.ReactElement => {
const { id, name, className, choices = [], required, ariaDescribedBy } = props;
const classes = cn("gc-combobox gcds-input-wrapper", className);

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [field, meta, helpers] = useField(props);
const { setValue } = helpers;

Expand All @@ -32,6 +31,7 @@ export const Combobox = (props: ComboboxProps): React.ReactElement => {
onSelectedItemChange({ selectedItem }) {
setValue(selectedItem);
},
initialInputValue: field.value || "",
});

return (
Expand Down

0 comments on commit 4531181

Please sign in to comment.