Skip to content

Commit f8c5807

Browse files
committed
fix _updateSelect bug
1 parent cfca6df commit f8c5807

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/js/components/SearchBar/index.svelte

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
let dropdownSelected = $state(false);
1616
1717
//updates UI when 'Collection' or 'Website' is selected in search options
18+
// sets a boolean for whether or not the dropdown for collection/website was selected
1819
let _updateSelect = function (event) {
1920
index = event.target.value;
2021
_root.dataset.index = event.target.value;
21-
if (index == 'library') {
22-
dropdownSelected = true;
23-
}
22+
dropdownSelected = true;
2423
};
2524
2625
function isSiteBabel() {
@@ -57,9 +56,7 @@
5756
if (_searchtype) {
5857
let value = _searchtype.value;
5958
_root.dataset.field = value;
60-
6159
let menuItem = _searchtype.options[_searchtype.selectedIndex];
62-
6360
console.log('-- updateSearchType', value, _searchtype, menuItem);
6461
fieldValue = menuItem.text;
6562
}
@@ -116,13 +113,14 @@
116113
const isAdvancedSearch = searchParams.get('adv') == '1';
117114
118115
if (isSiteBabel() || isWebsiteHome()) {
119-
console.log('isSiteBabel or isWebsite');
120116
_searchtypeValue = 'everything';
121117
_selectValue = 'library';
122118
// set _inputValue to q1 IF this is ls AND it's not a mondo collection
123119
if (location.pathname.match('/cgi/ls') && !searchParams.has('c')) {
124120
_inputValue = searchParams.get('q1');
125121
isFullView = !(searchParams.get('lmt') == 'all');
122+
} else if (dropdownSelected) {
123+
_selectValue = index;
126124
}
127125
} else if (isSiteCatalog()) {
128126
_searchtypeValue = searchParams.get('searchtype') || 'all';

0 commit comments

Comments
 (0)