Autocomplete dropup or down depending on height