Skip to content

Commit 35cd733

Browse files
fix(web): focus issue with controlled usage (#1917)
* fix: resolve conflicts * fix(web): focus issue with controlled usage
1 parent 6abbf82 commit 35cd733

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/web/src/components/search/SearchBox.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,12 @@ const SearchBox = (props) => {
448448
suggestion._category,
449449
);
450450
} else if (onChange) {
451-
onChange(suggestionValue, () =>
451+
onChange(suggestionValue, ({ isOpen } = {}) =>
452452
triggerQuery({
453453
customQuery: true,
454454
value: suggestionValue,
455455
categoryValue: suggestion._category,
456+
isOpen,
456457
}),
457458
);
458459
}
@@ -720,7 +721,7 @@ const SearchBox = (props) => {
720721
};
721722

722723
const handleFocus = (event) => {
723-
if (props.autosuggest && !onChange) {
724+
if (props.autosuggest) {
724725
setIsOpen(true);
725726
}
726727
if (props.onFocus) {

0 commit comments

Comments
 (0)