From 42c1f0aedcb570e907cd319c70de3f57d6d93b72 Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Sun, 26 Dec 2021 18:33:04 -0300 Subject: [PATCH] Sticky autocomplete --- static/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/static/index.js b/static/index.js index 2584834..29234df 100644 --- a/static/index.js +++ b/static/index.js @@ -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();