I have md-autocomplete
:
If you don't mind losing focus on the md-autocomplete input element on enter, you can close md-autocomplete suggestions without using hacky ways that involve messing with the internal $mdAutocompleteCtrl
controller. This depends on md-autocomplete to automatically hide suggestions when the input element is no longer focused.
ng-enter
) and add an ID to the input element using md-input-id
blur()
on the #autocomplete
input element
handleFormSubmit() {
angular.element(document.querySelector('#autocomplete')).blur();
}