Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ angular.module('mm.foundation.typeahead', ['mm.foundation.position', 'mm.foundat
//it might happen that several async queries were in progress if a user were typing fast
//but we are interested only in responses that correspond to the current view value
if (inputValue === modelCtrl.$viewValue && hasFocus) {
if (matches.length > 0) {
if (matches && matches.length > 0) {

scope.activeIdx = 0;
scope.matches.length = 0;
Expand Down Expand Up @@ -304,7 +304,7 @@ angular.module('mm.foundation.typeahead', ['mm.foundation.position', 'mm.foundat
scope.templateUrl = attrs.templateUrl;

scope.isOpen = function () {
return scope.matches.length > 0;
return scope.matches && scope.matches.length > 0;
};

scope.isActive = function (matchIdx) {
Expand Down