Commit 658c6c26 authored by Phil Hughes's avatar Phil Hughes

Fixed filter issue

parent c45dc802
...@@ -15,7 +15,7 @@ ...@@ -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),
}, },
}; };
} }
......
...@@ -20,8 +20,9 @@ ...@@ -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) {
......
...@@ -85,10 +85,9 @@ ...@@ -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);
} }
...@@ -146,7 +145,7 @@ ...@@ -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();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment