bug(autocomplete): ng-click doesn't work inside md-not-found

+1 I'm running into this as well with version 0.11.4.
<md-not-found>
"{{searchCategoryTxt}}" not found.
<a ng-href="#" ng-click="newCategory(searchCategoryTxt)">Add!</a>
</md-not-found>
My controller function never gets called. As @stewones mentions, even the demo one doesn't work - it doesn't show the alert.
+1 has been working in RC-1 and maybe RC-2, not working in RC-3
+1 not working since RC1 for me.
as workout: self.$mdAutocompleteCtrl.mouseUp = function(){ $timeout(function(){ inputElement.focus(); }); };
its not good, but for those who need make it to work at any cost!
My current fix is the following:
<md-autocomplete md-search-text-change="searchTextChange(searchText)" ...>
<md-not-found>
<span ng-click="ok()">Click here to create new item</span>
</md-not-found>
</md-autocomplete>
$scope.ok = function() {
document.querySelector('md-virtual-repeat-container').classList.add('ng-hide');
};
$scope.searchTextChange = function() {
document.querySelector('md-virtual-repeat-container').classList.remove('ng-hide');
};
@dominicgoulet @nestorneto I had to combine both of your solutions to get the hack working. Thanks guys.
Eagerly waiting for a fix.
Just override the mouseUp funcion of $mdAutocompleteCtrl. This worked for me. In my case I have a custom directive that uses the autocomplete component. So its easer for me to do that.
@nestorneto How did you go about hiding the list? I tried it in a few different ways, but only dominicgoulet's hack worked.
+1 @nestorneto and @dominicgoulet I tried your solution, but isn`t working for me. Could you provide an working example of your implementation? I really need this feature working in 1.0.
What's your problem with the current workaround @vlopez5 ?
@dominicgoulet I tried to do like your demo and still not possible click inside md-not-found. Also I can`t figure out where to put @nestorneto solution.
I am using RC5
Finally, there is a fix for that issue. #6103
Thank you @DevVersion ! I hope it gets merged soon...
Another workaround that worked for me is to change ng-click with ng-mousedown
My current fix is the following:
<md-autocomplete md-search-text-change="searchTextChange(searchText)" ...> <md-not-found> <span ng-click="ok()">Click here to create new item</span> </md-not-found> </md-autocomplete> $scope.ok = function() { document.querySelector('md-virtual-repeat-container').classList.add('ng-hide'); }; $scope.searchTextChange = function() { document.querySelector('md-virtual-repeat-container').classList.remove('ng-hide'); };
Thank You