Update expected field for response list

The existing code to handle the "enter key" / auto selections broke at some point. It was expecting results to be in an "items" list, not a "results" list. This should close #9928 hopefully. Tested locally.
This commit is contained in:
Sam 2021-09-23 20:12:45 -04:00 committed by GitHub
parent 6aa7e9cbfa
commit d0f284129a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -296,11 +296,11 @@ $(document).ready(function () {
}); });
// makes sure we're not selecting the same thing twice for multiples // makes sure we're not selecting the same thing twice for multiples
var filteredResponse = response.items.filter(function(item) { var filteredResponse = response.results.filter(function(item) {
return currentlySelected.indexOf(+item.id) < 0; return currentlySelected.indexOf(+item.id) < 0;
}); });
var first = (currentlySelected.length > 0) ? filteredResponse[0] : response.items[0]; var first = (currentlySelected.length > 0) ? filteredResponse[0] : response.results[0];
if(first && first.id) { if(first && first.id) {
first.selected = true; first.selected = true;