Skip to content

Commit e4a399a

Browse files
author
Jicheng Lu
committed
Merge branch 'main' of https://github.com/SciSharp/BotSharp-UI into features/add-stream-chat
2 parents 2d5d057 + eee0ded commit e4a399a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/lib/common/Select.svelte

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
$: {
8080
innerOptions = verifySelectedOptions(innerOptions, selectedValues);
8181
refOptions = verifySelectedOptions(innerOptions, selectedValues);
82+
applySearchFilter();
8283
changeDisplayText();
8384
}
8485
@@ -104,11 +105,15 @@
104105
...newOptions
105106
];
106107
108+
changeDisplayText();
109+
} else {
110+
applySearchFilter();
107111
changeDisplayText();
108112
}
109113
} else {
110114
innerOptions = verifySelectedOptions(options, selectedValues);
111115
refOptions = verifySelectedOptions(options, selectedValues);
116+
applySearchFilter();
112117
changeDisplayText();
113118
}
114119
}
@@ -162,18 +167,20 @@
162167
/** @param {any} e */
163168
function changeSearchValue(e) {
164169
searchValue = e.target.value || '';
170+
applySearchFilter();
171+
verifySelectAll();
172+
}
173+
174+
function applySearchFilter() {
165175
const innerValue = searchValue.toLowerCase();
166176
167177
if (searchValue) {
168178
innerOptions = [...refOptions.filter(x => x.label.toLowerCase().includes(innerValue))];
169179
} else {
170180
innerOptions = [...refOptions];
171181
}
172-
173-
verifySelectAll();
174182
}
175183
176-
177184
/**
178185
* @param {any} e
179186
* @param {any} option

0 commit comments

Comments
 (0)