Closed cedbesafilm closed 3 years ago
Pieces of code taken from ChoicesJS
I use rendered event because in resultsList the property bottom is always 0 (maybe is not injected in the DOM already?)
i.addEventListener("rendered", function() {
var shouldFlip = false;
var el = document.getElementById("autoComplete_list");
var dropdownPos = el.getBoundingClientRect().bottom
shouldFlip = !window.matchMedia("(min-height: " + (dropdownPos + 1) + "px)").matches;
if (shouldFlip) {
el.classList.add("is-flipped");
}
}, false);
#autoComplete_list.is-flipped {
top: auto;
bottom: 100%;
margin-bottom: 0rem;
}
On lower edge
Also I have the same problem. Would be good if the plugin will support that out of the box
Hello :) Yes, it would be great to have this feature, please take a look
@TarekRaafat Is there a way to always open the dropdown upwards? trying to figure out what CSS to apply
Is your feature request related to a problem? Please describe. Now the autocomplete open downwards in evey situation, on mobile the user can not notice the list open
Thoroughly Describe the solution you'd like if the autocomplete is open at the lower limit of the page the list should open upwards
Please provide a few use cases for this feature
Please Describe alternatives you've considered For now i'm studing a custom method when list renders
Additional context current behavior
expected behavior This is and example take from a Select