Skip to content

Commit

Permalink
fix(typeahead): replace ng-if with ng-show in matches popup
Browse files Browse the repository at this point in the history
  • Loading branch information
zackarychapple authored and Oron Nadiv committed Nov 18, 2014
1 parent 1f9e8b3 commit e04a36f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/typeahead/test/typeahead.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('typeahead tests', function () {
this.message = function () {
return 'Expected "' + angular.mock.dump(typeaheadEl) + '" to be closed.';
};
return typeaheadEl.length === 0;
return typeaheadEl.hasClass('ng-hide') === true;

}, toBeOpenWithActive: function (noOfMatches, activeIdx) {

Expand All @@ -80,7 +80,7 @@ describe('typeahead tests', function () {
this.message = function () {
return 'Expected "' + this.actual + '" to be opened.';
};
return typeaheadEl.length === 1 && liEls.length === noOfMatches && $(liEls[activeIdx]).hasClass('active');
return typeaheadEl.length === 1 && typeaheadEl.hasClass('ng-hide') === false && liEls.length === noOfMatches && $(liEls[activeIdx]).hasClass('active');
}
});
});
Expand Down Expand Up @@ -670,4 +670,4 @@ describe('typeahead tests', function () {
});
});

});
});
4 changes: 2 additions & 2 deletions template/typeahead/typeahead-popup.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ul class="dropdown-menu" ng-if="isOpen()" ng-style="{top: position.top+'px', left: position.left+'px'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">
<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position.top+'px', left: position.left+'px'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">
<li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">
<div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>
</li>
</ul>
</ul>

0 comments on commit e04a36f

Please sign in to comment.