=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/directives.js' --- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/directives.js 2014-07-06 12:46:18 +0000 +++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/directives.js 2014-08-12 10:04:27 +0000 @@ -207,13 +207,19 @@ .directive('typeaheadOpenOnFocus', function () { return { - require: ['typeahead', 'ngModel'], - link: function (scope, element, attr, ctrls) { - element.bind('focus', function () { - ctrls[0].getMatchesAsync(ctrls[1].$viewValue); - }); - } - }; + require: ['typeahead', 'ngModel'], + link: function (scope, element, attr, ctrls) { + element.bind('focus', function () { + ctrls[0].getMatchesAsync(ctrls[1].$viewValue); + + scope.$watch(attr.ngModel, function(value) { + if(value === '' || angular.isUndefined(value)){ + ctrls[0].getMatchesAsync(ctrls[1].$viewValue); + } + }); + }); + } + }; }) .directive('draggableModal', function(){