devbridge / jQuery-Autocomplete

Ajax Autocomplete for jQuery allows you to easily create autocomplete/autosuggest boxes for text input fields
https://www.devbridge.com/sourcery/components/jquery-autocomplete/
Other
3.57k stars 1.67k forks source link

[BUG][iOS] Incorrect suggestions position on IOS with minChars:0 option and fixed search input #832

Open gibigate opened 2 years ago

gibigate commented 2 years ago

We have a fixed positioning header with search input. When user scrolling down and click search input, local suggestion are displayed, then ios keyboard showing from bottom, so suggestions position are broken

styles:

.header {position:fixed; top:0; left:0; right:0;}

js:

$('.search-form').autocomplete({
        minChars: 0,
        paramName: 'q',
        lookup: function (query, done) {
            if(query==='') {
                var search_queries = searchHistory.getItems();
                done(search_queries);
            } else {
                    $.get('/suggest/',{q:query}, function(data) {
                        result = JSON.parse(data);
                        done(result);
                    });
            }
        }
    });

example: 2021-10-15 17 56 21