The menu get truncated if the dropdown at the end of the page, I fixed this issue by calling setMenuLocation function from the end of fucntion " AbstractChosen.prototype.winnow_results "
if (!(options != null ? options.skip_highlight : void 0)) {
//calling the function here
setMenuLocation(this.dropdown[0], this.search_choices[0]);
return this.winnow_results_set_highlight();
}
this function will determine if you are at the end of the page and will switch the menu to show at the top of the search choices.
function setMenuLocation(node, chosen) {
var docH = document.documentElement.offsetHeight;
var y = node.getBoundingClientRect().y;
var h = node.offsetHeight;
var pH = chosen.offsetHeight;
var pY = chosen.getBoundingClientRect().y;
if ((pY + h + pH) > (docH - 50)) {
node.style.top = (-h) + "px";
} else if (y != 0 && h != 0) {
node.style.top = "100%"
}
}
The menu get truncated if the dropdown at the end of the page, I fixed this issue by calling setMenuLocation function from the end of fucntion " AbstractChosen.prototype.winnow_results "
if (!(options != null ? options.skip_highlight : void 0)) { //calling the function here setMenuLocation(this.dropdown[0], this.search_choices[0]); return this.winnow_results_set_highlight(); }
this function will determine if you are at the end of the page and will switch the menu to show at the top of the search choices.
function setMenuLocation(node, chosen) { var docH = document.documentElement.offsetHeight; var y = node.getBoundingClientRect().y; var h = node.offsetHeight; var pH = chosen.offsetHeight; var pY = chosen.getBoundingClientRect().y; if ((pY + h + pH) > (docH - 50)) { node.style.top = (-h) + "px"; } else if (y != 0 && h != 0) { node.style.top = "100%" } }