client/search: correct case in autocompleted tags
This commit is contained in:
parent
977cc47966
commit
8f275206af
1 changed files with 2 additions and 5 deletions
|
@ -6,7 +6,6 @@ const AutoCompleteControl = require('./auto_complete_control.js');
|
|||
|
||||
class TagAutoCompleteControl extends AutoCompleteControl {
|
||||
constructor(input, options) {
|
||||
const caseSensitive = false;
|
||||
const minLengthForPartialSearch = 3;
|
||||
|
||||
options = Object.assign({
|
||||
|
@ -14,9 +13,7 @@ class TagAutoCompleteControl extends AutoCompleteControl {
|
|||
}, options);
|
||||
|
||||
options.getMatches = text => {
|
||||
const transform = caseSensitive ?
|
||||
x => x :
|
||||
x => x.toLowerCase();
|
||||
const transform = x => x.toLowerCase();
|
||||
const match = text.length < minLengthForPartialSearch ?
|
||||
(a, b) => a.startsWith(b) :
|
||||
(a, b) => a.includes(b);
|
||||
|
@ -40,7 +37,7 @@ class TagAutoCompleteControl extends AutoCompleteControl {
|
|||
<span class="${cssName}">
|
||||
${origName} (${usages})
|
||||
</span>`,
|
||||
value: kv[0],
|
||||
value: origName,
|
||||
};
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue