angularjs - Clear button in AutoComplete of Angular Material blocks all the DOM elements -
yes, rare situation somehow, if use autocomplete follows, dom elements blocked , cant interact anymore element page.
this html-part:
<md-autocomplete style="background-color:white; height:10px;" md-selected-item="selecteditem" md-search-text-change="searchtextchange(searchtext)" md-search-text="searchtext" md-selected-item-change="selecteditemchange(item)" md-items="item in querysearch(searchtext) | orderby:'text'" md-item-text="item.text" md-min-length="0" placeholder="filteren op tag" md-menu-class="autocomplete-custom-template"> <md-item-template style="background-color:white;"> <span class="select-title"> <!--<md-icon md-svg-icon="selectboxicon.svg"></md-icon>--> <span class="item-tags"> {{item.text}} </span> </span> </md-item-template> </md-autocomplete>
and corresponding parts controller:
$scope.querysearch = function (query) { var results = query ? $scope.alltags.filter($scope.createfilterfor(query)) : $scope.alltags; return results; } $scope.createfilterfor = function (query) { var lowercasequery = angular.lowercase(query); return function filterfn(item) { console.log(item); var itemname = angular.lowercase(angular.lowercase(item.text)); return (itemname.indexof(lowercasequery) === 0); }; } $scope.searchtextchange = function searchtextchange(text) { $log.info('text changed ' + text); } $scope.selecteditemchange = function selecteditemchange(item) { console.log("selected"); console.log(item); }
ps: every functionality works fine , without error. clicking clear button - shown in following image- causes problem -tested in last versions of chrome , mozilla-.
there issue posted on github regarding this. can check out here.
it resolved in update 0.10.1-rc4.
update angular-material master.
temporary workaround:
css:
.md-scroll-mask{ position: initial }
Comments
Post a Comment