Autocomplete: set input to selected value when 1 option
This commit is contained in:
parent
fde1a65d6a
commit
bd24f9044c
1 changed files with 3 additions and 2 deletions
|
@ -182,8 +182,8 @@
|
|||
let voie;
|
||||
for (i in voies) {
|
||||
voie = voies[i]
|
||||
$("#voies").append("<option id=" + voie[1] + " value='" +
|
||||
voie[0] + "'></option>");
|
||||
$("#voies").append("<option value='" +
|
||||
voie[1] + "'>" + voie[0] + "</option>");
|
||||
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');
|
||||
|
|
Loading…
Reference in a new issue