sr-npm 1.7.274 → 1.7.275

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.274",
3
+ "version": "1.7.275",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,6 +18,7 @@ const {
18
18
  let queryKeyWordVar;
19
19
  let queryDepartmentVar;
20
20
  let queryLocationVar;
21
+ let searchInputIsUsed=false;
21
22
  async function careersPageOnReady(_$w,thisObject,queryParams) {
22
23
  console.log("queryParams: ", queryParams);
23
24
  const { page, keyWord, department, location } = queryParams;
@@ -162,6 +163,7 @@ async function bind(_$w) {
162
163
  function init(_$w) {
163
164
 
164
165
  _$w('#searchInput').onInput(onchangeSearchInput);
166
+ _$w('#searchInput').onBlur(()=>searchInputIsUsed=false);
165
167
  _$w('#dropdownDepartment, #dropdownLocation, #dropdownJobType').onChange(()=>applyFilters(_$w));
166
168
  _$w('#resetFiltersButton, #clearSearch').onClick(()=>resetFilters(_$w));
167
169
 
@@ -179,6 +181,10 @@ function onchangeSearchInput(_$w){
179
181
  const debouncedSearch = debounce(()=>applyFilters(_$w), 400,thisObjectVar);
180
182
  debouncedSearch();
181
183
  _$w('#searchInput').focus();
184
+
185
+
186
+ console.log("onchangeSearchInput");
187
+ searchInputIsUsed=true;
182
188
  }
183
189
 
184
190
  async function applyFilters(_$w, skipUrlUpdate = false) {
@@ -255,6 +261,9 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
255
261
  // Update reset button state
256
262
  const hasActiveFilters = filters.length > 0;
257
263
  hasActiveFilters? _$w('#resetFiltersButton').enable() : _$w('#resetFiltersButton').disable();
264
+ if(searchInputIsUsed){
265
+ _$w('#searchInput').focus();
266
+ }
258
267
 
259
268
 
260
269
  }