diff --git a/.changeset/silent-feet-double.md b/.changeset/silent-feet-double.md new file mode 100644 index 000000000..5efb87573 --- /dev/null +++ b/.changeset/silent-feet-double.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": patch +--- + +Fix unable to select value in simple autocomplete field diff --git a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx index a52458cf5..2af23bcf5 100644 --- a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx +++ b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx @@ -108,7 +108,8 @@ const SingleAutocompleteSelectFieldComponent: React.FC< // this is to prevent unwanted state updates when the dropdown is closed with an empty value, // which downshift interprets as the value being updated with an empty string, causing side-effects stateReducer={(_, changes) => { - if (!changes.isOpen) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare + if (changes.isOpen === false) { delete changes.inputValue; } return changes;