From cf9b6d07255442f701137657f08324c8d0476db1 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 22 Jul 2018 18:34:58 -0700 Subject: [PATCH] Workaround autocomplete box sticking around after submitting. --- README.md | 2 -- frontends/etiquette_flask/templates/search.html | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5fed471..6c67d2f 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,6 @@ Here is a brief overview of the project to help you learn your way around: - Add a new table to store permanent history of add/remove of tags on photos, so that accidents or trolling can be reversed. - Fix album size cache when photo reload metadata and generally improve that validation. - Better bookmark url validation. -- Create a textbox which gives autocomplete tag names. -- In the same vein, use a dedicated endpoint with etag caching for providing the full list of tag names, so the client can check up on it and store the results in localstorage, and use for the autocomplete system. - Consider if the "did you commit too early" warning should actually be an exception. - Extension currently does not believe in the override filename. On one hand this is kind of good because if they override the name to have no extension, we can still provide a downloadable file with the correct extension by remembering it. But on the other hand it does break the illusion of override_filename. - When batch fetching objects, consider whether or not a NoSuch should be raised. Perhaps a warningbag should be used. diff --git a/frontends/etiquette_flask/templates/search.html b/frontends/etiquette_flask/templates/search.html index 7b85b53..6e60293 100644 --- a/frontends/etiquette_flask/templates/search.html +++ b/frontends/etiquette_flask/templates/search.html @@ -372,6 +372,13 @@ function add_searchtag(box, value, inputted_list, li_class) box_li = box.parentElement; ul = box_li.parentElement; ul.insertBefore(new_li, box_li); + + // The datalist autocomplete box can sometimes stick around after the + // tag has already been submitted and the input box moves down -- now + // covered by the autocomplete. So we temporarily unfocus it to make + // that thing go away. + box.blur(); + box.focus(); } } function remove_searchtag(li_member, value, inputted_list)