From bd24f9044ca0ad9c9cb5371afd4922c1e0585f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Baylac-Jacqu=C3=A9?= Date: Sat, 12 Feb 2022 23:50:33 +0100 Subject: [PATCH] Autocomplete: set input to selected value when 1 option --- templates/landing_form.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/landing_form.html b/templates/landing_form.html index 49cf39d..3a9ed69 100644 --- a/templates/landing_form.html +++ b/templates/landing_form.html @@ -182,8 +182,8 @@ let voie; for (i in voies) { voie = voies[i] - $("#voies").append(""); + $("#voies").append(""); if (voie[0] === search) { valueMatch=true; } @@ -191,6 +191,7 @@ if (voies.length == 1 || valueMatch) { $('#btnTestAdresse').collapse('show'); voie = voies[0] + $("#voieInput").val(voie[0]); $('#btnTestAdresse').focus(); } else { $('#btnTestAdresse').collapse('hide');