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

Fixed filter issue

parent c45dc802
......@@ -15,7 +15,7 @@
loadingTemplate: this.loadingTemplate,
},
droplabFilter: {
filterFunction: gl.DropdownUtils.filterWithSymbol.bind(null, this.symbol),
filterFunction: gl.DropdownUtils.filterWithSymbol.bind(null, this.symbol, input),
},
};
}
......
......@@ -20,8 +20,9 @@
return escapedText;
}
static filterWithSymbol(filterSymbol, item, query) {
static filterWithSymbol(filterSymbol, input, item) {
const updatedItem = item;
const query = gl.DropdownUtils.getSearchInput(input).trim();
const { lastToken, searchToken } = gl.FilteredSearchTokenizer.processTokens(query);
if (lastToken !== searchToken) {
......
......@@ -85,10 +85,9 @@
this.font = window.getComputedStyle(this.filteredSearchInput).font;
}
const inputText = gl.DropdownUtils.getSearchInput(this.filteredSearchInput).trim();
const filterIconPadding = 27;
const offset = gl.text
.getTextWidth(gl.DropdownUtils.getSearchInput(this.filteredSearchInput).trim(), this.font)
+ filterIconPadding;
const offset = gl.text.getTextWidth(inputText, this.font) + filterIconPadding;
this.mapping[key].reference.setOffset(offset);
}
......@@ -146,7 +145,7 @@
const { lastToken, searchToken } = this.tokenizer
.processTokens(gl.DropdownUtils.getSearchInput(this.filteredSearchInput));
if (this.filteredSearchInput.value.split('').last() === ' ') {
if (this.currentDropdown) {
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