From d4a3a740b2bc93f7b92d880b18ec66bce920c983 Mon Sep 17 00:00:00 2001 From: Saurabh Gedam Date: Wed, 29 Sep 2021 08:24:04 -0700 Subject: [PATCH] fix(search): ES-2439 change debounce wait time for search (#2115) --- CHANGELOG.md | 2 +- assets/js/theme/global/quick-search.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac19602324..5bb17f5656 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/assets/js/theme/global/quick-search.js b/assets/js/theme/global/quick-search.js index 200b0c2845..2757973cb1 100644 --- a/assets/js/theme/global/quick-search.js +++ b/assets/js/theme/global/quick-search.js @@ -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) { @@ -62,7 +63,7 @@ export default function () { }, 100); } }); - }, 200); + }, debounceWaitTime); utils.hooks.on('search-quick', (event, currentTarget) => { const searchQuery = $(currentTarget).val();