Fix show selected content in single autocomplete field (#3855)
This commit is contained in:
parent
fec476b7e2
commit
72d4df482e
2 changed files with 7 additions and 1 deletions
5
.changeset/silent-feet-double.md
Normal file
5
.changeset/silent-feet-double.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"saleor-dashboard": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix unable to select value in simple autocomplete field
|
|
@ -108,7 +108,8 @@ const SingleAutocompleteSelectFieldComponent: React.FC<
|
||||||
// this is to prevent unwanted state updates when the dropdown is closed with an empty value,
|
// 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
|
// which downshift interprets as the value being updated with an empty string, causing side-effects
|
||||||
stateReducer={(_, changes) => {
|
stateReducer={(_, changes) => {
|
||||||
if (!changes.isOpen) {
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
|
||||||
|
if (changes.isOpen === false) {
|
||||||
delete changes.inputValue;
|
delete changes.inputValue;
|
||||||
}
|
}
|
||||||
return changes;
|
return changes;
|
||||||
|
|
Loading…
Reference in a new issue