mdAutocomplete wrongly triggers md-selected-item-change
This can be reproduced using the basic usage demo of md-autocomplete.
- Type in
Alainto the input field - Select
Alabama(with keyboard or mouse) - Focus should still be in input field. Type one more character.
- Issue: After typing this character the md-selected-item-change callback is called and in the console you see this:
Item changed to undefined
I would expect that only the md-search-text-change callback would be triggered.
Entering more characters does not trigger this, only the first character after selecting an item.
I don't think that the selected item should change just because another character changes in the input box.
If code in your md-search-text-change callback depends on what item was last selected then you run into problems because your selected item is now null.
This problem exists in 0.10.0 and 0.10.1 release candidates up to rc3
This is as designed. When the search text no longer matches your selected item, the selected item is reset. This is necessary for a number of reasons.
This makes it impossible to trigger a callback on the actual item selected though. I pretty much always get null/undefined when the callback is run and nothing happens when I select the item