From 5f915541986db8caa6fff0ad5a0dc4da07653845 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 25 Oct 2020 20:20:40 -0700 Subject: [PATCH] Don't break the mmf inputs when autocomplete init failed. --- frontends/etiquette_flask/templates/search.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontends/etiquette_flask/templates/search.html b/frontends/etiquette_flask/templates/search.html index a86ae97..118a1da 100644 --- a/frontends/etiquette_flask/templates/search.html +++ b/frontends/etiquette_flask/templates/search.html @@ -436,9 +436,14 @@ function add_searchtag_from_box(box, inputted_list, li_class) {return;} let value = box.value; - value = tag_autocomplete.resolve(value); - if (value === null) - {return;} + if (tag_autocomplete.datalist !== null) + { + // If the autocomplete failed for whatever reason, or is simply taking + // too long, let's just let it slide. + value = tag_autocomplete.resolve(value); + if (value === null) + {return;} + } console.log(inputted_list); ul = box.parentElement.parentElement;