Skip to content
Snippets Groups Projects
Commit 98dbb8e2 authored by Jose Ivan Vargas Lopez's avatar Jose Ivan Vargas Lopez Committed by Phil Hughes
Browse files

Introduced an offset limit to prevent the dropdown from going far right

parent f6f52b43
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -90,7 +90,15 @@
const input = this.filteredSearchInput;
const inputText = input.value.slice(0, input.selectionStart);
const filterIconPadding = 27;
const offset = gl.text.getTextWidth(inputText, this.font) + filterIconPadding;
let offset = gl.text.getTextWidth(inputText, this.font) + filterIconPadding;
const currentDropdownWidth = this.mapping[key].element.clientWidth === 0 ? 200 :
this.mapping[key].element.clientWidth;
const offsetMaxWidth = this.filteredSearchInput.clientWidth - currentDropdownWidth;
if (offsetMaxWidth < offset) {
offset = offsetMaxWidth;
}
 
this.mapping[key].reference.setOffset(offset);
}
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