user1828605 user1828605 - 1 year ago 652
AngularJS Question

Is it possible to simulate `md-selected-item` on ng-blur in angular-material md-autocomplete?

I'm creating this angular app using angular-material where md-autocomplete is very helpful. The form allows users to select or enter data in a field, and the next field populates the data based on the value from the first md-autocomplete field. If the user selects the item from the list, then

has the object that I need for the next field. However, if the user only copies a value and pastes in the md-autocomplete field and tabs to the next field, the value is not populated because
. Is there a way where I can simulate


As mentioned in the comments section, you'll have to manually listen for the TAB key. - Clearly states this feature won't be added to the library.

On the other hand, for the copy-paste issue you could add md-select-on-match directive to your autocomplete. This should automatically select the option on exact match. You might consider using md-match-case-insensitive with this option though.