Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(search): ES-2439 change debounce wait time for search #2115

Merged
merged 6 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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)

## 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)
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