Skip to content

Commit

Permalink
merge to keywordfilter
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnito committed Jul 17, 2019
1 parent 5ab7610 commit aedfea5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/KeywordFilter/KeywordFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ class KeywordFilter extends Component {
const handleChangeWithDebounce = (urlParam, values) => {
// handleSubmit gets urlParam and values as params.
// If this field ("keyword") is short, create timeout
if (urlParam && values && values[name] && values[name].length >= 3) {
const hasKeywordValue = values && values[name];
const keywordValue = hasKeywordValue ? values && values[name] : '';
if (urlParam && (!hasKeywordValue || (hasKeywordValue && keywordValue.length >= 3))) {
if (this.shortKeywordTimeout) {
window.clearTimeout(this.shortKeywordTimeout);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchFiltersMobile/SearchFiltersMobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ class SearchFiltersMobileComponent extends Component {
</div>
{this.state.isFiltersOpenOnMobile ? (
<div className={css.filtersWrapper}>
{keywordFilterElement}
{categoryFilterElement}
{amenitiesFilterElement}
{priceFilterElement}
{dateRangeFilterElement}
{keywordFilterElement}
</div>
) : null}

Expand Down

0 comments on commit aedfea5

Please sign in to comment.