Sticky autocomplete

This commit is contained in:
Augusto Gunsch 2021-12-26 18:33:04 -03:00
parent edeece9d7c
commit 42c1f0aedc
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 1 additions and 4 deletions

View File

@ -18,6 +18,7 @@ $(document).ready(() => {
let searchBar = $('#search-bar');
searchBar.autocomplete({
appendTo: '#search-form',
source: (request, response) => {
$.ajax({
url: '/langs/polish/words?like=' + request.term + '&limit=20&offset=0',
@ -31,10 +32,6 @@ $(document).ready(() => {
setTimeout(() => e.currentTarget.select(), 100);
});
$(window).on('scroll', () => {
searchBar.autocomplete('close');
});
$('#search-form').on('submit', (e) => {
e.preventDefault();