Skip to content

Commit

Permalink
fix(search): ES-2439 change debounce wait time for search (#2115)
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabhgedam authored Sep 29, 2021
1 parent 4d0aa8c commit d4a3a74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Draft
- Changed debounce wait time for search to 1200 ms from 200 ms. [#2115](https://github.com/bigcommerce/cornerstone/pull/2115)
- additional checkout buttons don't work on applying 100% discount coupon. [#2109](https://github.com/bigcommerce/cornerstone/pull/2109)
- Fix sliding carousel with products cause footer headers flickering. [#2119](https://github.com/bigcommerce/cornerstone/pull/2119)


## 6.1.0 (09-03-2021)
- Fixed images placeholder on hero carousel shifted on mobile when slide has content. [#2112](https://github.com/bigcommerce/cornerstone/pull/2112)
- Google AMP feature request - Add in release date info for preorder products. [#2107](https://github.com/bigcommerce/cornerstone/pull/2107)
Expand Down
5 changes: 3 additions & 2 deletions assets/js/theme/global/quick-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export default function () {
}
};

// stagger searching for 200ms after last input
// stagger searching for 1200ms after last input
const debounceWaitTime = 1200;
const doSearch = _.debounce((searchQuery) => {
utils.api.search.search(searchQuery, { template: 'search/quick-results' }, (err, response) => {
if (err) {
Expand Down Expand Up @@ -62,7 +63,7 @@ export default function () {
}, 100);
}
});
}, 200);
}, debounceWaitTime);

utils.hooks.on('search-quick', (event, currentTarget) => {
const searchQuery = $(currentTarget).val();
Expand Down

0 comments on commit d4a3a74

Please sign in to comment.