fix(search bar): fixed unexpected search bar openings & lack of search value in input on load
1 unresolved thread
Description
Fixed two bugs Opening a map from URL without a pin/search forces empty search URL with search results does not fill out the search bar
when searchValue is empty it no longer shows in queryParams
Merge request reports
Activity
Filter activity
requested review from @AdrianOrlow and @mateusz-winiarczyk
19 19 const queryDataParams: QueryDataParams = { 20 searchValue: searchValue.join(';'), 21 20 perfectMatch, 22 21 modelId, 23 22 backgroundId, 24 23 ...position.last, 25 24 }; 26 25 26 /** prevent searchValueQuery from being empty */ 27 if (searchValue.length > ZERO) { 28 const joinedSearchValue = searchValue.join(';'); 29 if (joinedSearchValue) { 30 queryDataParams.searchValue = joinedSearchValue; 31 } 32 } 33 - Comment on lines +27 to +33
IMO side effect here is difficult to notice
You may extract searchValue to separate variable and include it in queryDataParams
const searchValueJoined = searchValue.join(';'); const shouldIncludeSearchValue = searchValueJoined.length > ZERO const queryDataParams: QueryDataParams = { perfectMatch, modelId, backgroundId, ...position.last, ...shouldIncludeSearchValue ? { searchValue: searchValueJoined } : {} };
changed this line in version 2 of the diff
added 24 commits
-
833efb35...d6dd7738 - 22 commits from branch
development
- 6b0a3cf0 - Merge branch 'development' into fix/search-bar-query-params
- 86096805 - refactor(query selector): improved code readability
-
833efb35...d6dd7738 - 22 commits from branch
enabled an automatic merge when the pipeline for 86096805 succeeds
mentioned in commit 33a6d7f2
Please register or sign in to reply