Skip to content

Commit 28b2eb8

Browse files
authored
Merge pull request #833 from TerriaJS/issue/728
Issue/728 Fixed an issue that search may not be added to recent search list in some cases
2 parents 3becec2 + 6e267f2 commit 28b2eb8

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
* Fixed an issue that users may see an error after page 4
4949
* Fixed an issue that prevents users from searching current search text by clicking search button or pressing enter key
5050
* keep distance between search box and the first story on mobile view
51+
* Fixed an issue search may not be added to recent search list in some cases
52+
* Make small position adjustment to the recent search icon
5153
* Added spacing between download & new tab button on dataset page
5254
* Added spacing on byline of dataset page
5355
* Moved homepage config from S3 to local

magda-web-client/src/Components/Search/SearchSuggestionBox.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { Small, Medium } from "../../UI/Responsive";
99
import "./SearchSuggestionBox.css";
1010
import recentSearchIcon from "../../assets/updated.svg";
1111
import closeIcon from "../../assets/mobile-menu-close.svg";
12-
import isEqual from "lodash.isequal";
1312

1413
type searchDataType = {
1514
name: ?string,
@@ -166,8 +165,6 @@ class SearchSuggestionBox extends Component {
166165
const searchData = this.createSearchDataFromProps(newProps);
167166
if (!searchData) return;
168167
if (!searchData.data.q || !searchData.data.q.trim()) return;
169-
const currentSearchData = this.createSearchDataFromProps(prevProps);
170-
if (isEqual(currentSearchData, searchData)) return;
171168
const recentSearches = this.insertItemIntoLocalData(
172169
"recentSearches",
173170
searchData
@@ -187,7 +184,7 @@ class SearchSuggestionBox extends Component {
187184
isMouseOver: false,
188185
selectedItemIdx: null
189186
});
190-
this.searchInputRef.blur();
187+
if (this.searchInputRef) this.searchInputRef.blur();
191188
}
192189

193190
onSearchItemClick(e, item: searchDataType) {

magda-web-client/src/Components/Search/SearchSuggestionBox.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
margin-left: 3px;
5555
}
5656
@media (max-width: $medium - 1) {
57-
margin-top: 6px;
57+
margin-top: 5.5px;
5858
}
5959
float: left;
6060
width: 25px;

0 commit comments

Comments
 (0)