Skip to content

Commit 60ef2a7

Browse files
authored
Add fullTextSearch to dropdowns by default (#14694)
This PR adds `fullTextSearch: 'exact'` to most dropdown invocations meaning that if there is a search box for the dropdown it will automatically do a fullTextSearch looking for the provided fragment instead of starting at the beginning We should consider changing other places that use `fullTextSearch: true` to `'exact'` because these will be using a fuzzy-textual search that doesn't necessarily return the expected results. Fix #14689 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 0a9a484 commit 60ef2a7

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

web_src/js/features/gitgraph.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export default async function initGitGraph() {
7474
$('#flow-select-refs-dropdown').dropdown('set selected', dropdownSelected);
7575
$('#flow-select-refs-dropdown').dropdown({
7676
clearable: true,
77+
fullTextSeach: 'exact',
7778
onRemove(toRemove) {
7879
if (toRemove === '...flow-hide-pr-refs') {
7980
params.delete('hide-pr-refs');

web_src/js/index.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,18 +2408,23 @@ $(document).ready(async () => {
24082408
});
24092409

24102410
// Semantic UI modules.
2411-
$('.dropdown:not(.custom)').dropdown();
2411+
$('.dropdown:not(.custom)').dropdown({
2412+
fullTextSearch: 'exact'
2413+
});
24122414
$('.jump.dropdown').dropdown({
24132415
action: 'hide',
24142416
onShow() {
24152417
$('.poping.up').popup('hide');
2416-
}
2418+
},
2419+
fullTextSearch: 'exact'
24172420
});
24182421
$('.slide.up.dropdown').dropdown({
2419-
transition: 'slide up'
2422+
transition: 'slide up',
2423+
fullTextSearch: 'exact'
24202424
});
24212425
$('.upward.dropdown').dropdown({
2422-
direction: 'upward'
2426+
direction: 'upward',
2427+
fullTextSearch: 'exact'
24232428
});
24242429
$('.ui.accordion').accordion();
24252430
$('.ui.checkbox').checkbox();
@@ -3465,6 +3470,7 @@ function initTopicbar() {
34653470
topicDropdown.dropdown({
34663471
allowAdditions: true,
34673472
forceSelection: false,
3473+
fullTextSearch: 'exact',
34683474
fields: {name: 'description', value: 'data-value'},
34693475
saveRemoteData: false,
34703476
label: {

0 commit comments

Comments
 (0)