BigW Consortium Gitlab

Commit 0161c294 by Jacob Schatz Committed by Robert Speicher

Merge branch '26618-search-bar-dropdown-offset-should-not-go-past-search-bar-input' into 'master'

Introduced an offset limit to prevent the dropdown from going far right Closes #26618 and #27023 See merge request !8679
parent c4a9ea6c
......@@ -98,7 +98,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);
}
......
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