Autocomplete: Unable to select item with either 'return' or mouse

When I type in 'san d' , a list of cities drops down. Whether I click on a result with my mouse, or use the arrow keys and 'return' keyboard key to select an item, the selected text is not updated and stays at 'san d'.
I tried to follow the model in the demo (https://material.angularjs.org/#/demo/material.components.autocomplete) as closely as possible, but can't get it to select as it does in the demo.
My code
<md-autocomplete md-selected-item="selectedItem" md-search-text="searchText" md-items="item in cityLookup(searchText)" md-item-text="item.display"> <span md-highlight-text="searchText">{{item}}</span> </md-autocomplete>
and cityLookup returns a list of cities
cityLookup = function (query) { var This = this; if (query && query.length > 2) { var url = "/api/location/city?q=" + query; return This._http.get(url).then(function(response){ return response.data; }); } };
Everyone's help is much appreciated, and please let me know what other details I can give to resolve this :)
I looked at semi-related issue #1527 , but am still perplexed as to why neither the 'return' nor mouse click is updating what's selected.
What is the exact json you get back. Maybe md-item-text is the culprit
I updated to 0.8.0-rc1-master-71b17ba few minutes ago and I have same error. It's not related with any custom callback.
Are there any errors being logged to the console?
Hi everyone! This is the first issue I've ever opened, so it's cool getting some feedback!
So there was a 2 part fix :)
First, I used <script src="https://rawgit.com/angular/bower-material/master/angular-material.js"></script> instead of <script src="https://rawgit.com/angular/bower-material/v0.8.0-rc1/angular-material.js"></script>
- I realized something was up after I copy and pasted the exact code from the Material Design demo, and still wasn't able to select an item with either 'return' or mouse click. I don't think the fix described in #1527 has been released yet, so using the RawGit above, I was able to use the latest, most-current build version. (But this also makes me wonder, how are other people using the autocomplete in version 0.8.0?)
And second, good eye @david-gang. The objects in the array I was returning didn't have a 'display' property, (which the Angular demo had). So I changed md-item-text="item.display" to md-item-text="item" and now it works great. So that was my beginner's mistake :)
Hope this is helpful! Devil's in the details
@robertmesserle There is no logs in console. It does work on 0.7.1-master-ffa11c7.
@ericodes FYI this ticket should definitely stay open :)
@kdela :) there we go
@kdela
May you please provide a plunkr for this issue?
@david-gang Of course. I'll do that little later.
Possibly related: if you click and hold on a list item, something similar to this happens. The list disappears and the option you had selected / were selecting will not be placed in the input.
Looks like a blur event fires, and the click event never does.
@kdela Closing until there is a Plunker or CodePen to demonstrate. Cannot recreate.