Skip to content
Snippets Groups Projects
Commit 658c6c26 authored by Phil Hughes's avatar Phil Hughes
Browse files

Fixed filter issue

parent c45dc802
No related branches found
No related tags found
No related merge requests found
Loading
@@ -15,7 +15,7 @@
Loading
@@ -15,7 +15,7 @@
loadingTemplate: this.loadingTemplate, loadingTemplate: this.loadingTemplate,
}, },
droplabFilter: { droplabFilter: {
filterFunction: gl.DropdownUtils.filterWithSymbol.bind(null, this.symbol), filterFunction: gl.DropdownUtils.filterWithSymbol.bind(null, this.symbol, input),
}, },
}; };
} }
Loading
Loading
Loading
@@ -20,8 +20,9 @@
Loading
@@ -20,8 +20,9 @@
return escapedText; return escapedText;
} }
   
static filterWithSymbol(filterSymbol, item, query) { static filterWithSymbol(filterSymbol, input, item) {
const updatedItem = item; const updatedItem = item;
const query = gl.DropdownUtils.getSearchInput(input).trim();
const { lastToken, searchToken } = gl.FilteredSearchTokenizer.processTokens(query); const { lastToken, searchToken } = gl.FilteredSearchTokenizer.processTokens(query);
   
if (lastToken !== searchToken) { if (lastToken !== searchToken) {
Loading
Loading
Loading
@@ -85,10 +85,9 @@
Loading
@@ -85,10 +85,9 @@
this.font = window.getComputedStyle(this.filteredSearchInput).font; this.font = window.getComputedStyle(this.filteredSearchInput).font;
} }
   
const inputText = gl.DropdownUtils.getSearchInput(this.filteredSearchInput).trim();
const filterIconPadding = 27; const filterIconPadding = 27;
const offset = gl.text const offset = gl.text.getTextWidth(inputText, this.font) + filterIconPadding;
.getTextWidth(gl.DropdownUtils.getSearchInput(this.filteredSearchInput).trim(), this.font)
+ filterIconPadding;
   
this.mapping[key].reference.setOffset(offset); this.mapping[key].reference.setOffset(offset);
} }
Loading
@@ -146,7 +145,7 @@
Loading
@@ -146,7 +145,7 @@
const { lastToken, searchToken } = this.tokenizer const { lastToken, searchToken } = this.tokenizer
.processTokens(gl.DropdownUtils.getSearchInput(this.filteredSearchInput)); .processTokens(gl.DropdownUtils.getSearchInput(this.filteredSearchInput));
   
if (this.filteredSearchInput.value.split('').last() === ' ') { if (this.currentDropdown) {
this.updateCurrentDropdownOffset(); this.updateCurrentDropdownOffset();
} }
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment