Skip to content

Commit

Permalink
fix(web): keep suggestion container active when typping is on
Browse files Browse the repository at this point in the history
  • Loading branch information
bietkul committed Oct 22, 2020
1 parent ae863b6 commit 1c8d99a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/web/src/components/search/CategorySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ class CategorySearch extends Component {
{
currentValue: value || '',
currentCategory: category || null,
suggestions: [],
},
() => {
if (isDefaultValue) {
Expand Down Expand Up @@ -651,7 +650,7 @@ class CategorySearch extends Component {

handleStateChange = (changes) => {
const { isOpen, type } = changes;
if (type === Downshift.stateChangeTypes.mouseUp) {
if (type === Downshift.stateChangeTypes.mouseUp && isOpen !== undefined) {
this.setState({
isOpen,
});
Expand Down
3 changes: 1 addition & 2 deletions packages/web/src/components/search/DataSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ class DataSearch extends Component {
this.setState(
{
currentValue: value,
suggestions: [],
},
() => {
if (isDefaultValue) {
Expand Down Expand Up @@ -566,7 +565,7 @@ class DataSearch extends Component {

handleStateChange = (changes) => {
const { isOpen, type } = changes;
if (type === Downshift.stateChangeTypes.mouseUp) {
if (type === Downshift.stateChangeTypes.mouseUp && isOpen !== undefined) {
this.setState({
isOpen,
});
Expand Down

0 comments on commit 1c8d99a

Please sign in to comment.