Fix show selected content in single autocomplete field (#3855)

This commit is contained in:
Paweł Chyła 2023-07-05 09:31:44 +02:00 committed by GitHub
parent fec476b7e2
commit 72d4df482e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---
Fix unable to select value in simple autocomplete field

View file

@ -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;