user0187409 user0187409 - 1 month ago 7
CSS Question

Autocomplete List Fixed Position Browser Resize

I am using MVC 5 with Twitter bootstrap. Recently implemented an autocomplete for a list of Cities. The problem is that if I resize the window while the autocomplete list is shown it remains in a fixed position instead of being below the input text field.

Example on this link

Here

Image Result

Answer

You could include javascript to detect the browser resize and close the Autocomplete box when that event is triggered:

$(window).resize(function() {
   $("#myAutoComplete").autocomplete("close");
});