Skip to content

Commit e04a36f

Browse files
zackarychappleOron Nadiv
authored and
Oron Nadiv
committed
fix(typeahead): replace ng-if with ng-show in matches popup
Fixes angular-ui#2474 Fixes angular-ui#2541 Fixes angular-ui#2293 Closes angular-ui#2535 Closes angular-ui#2557
1 parent 1f9e8b3 commit e04a36f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: src/typeahead/test/typeahead.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('typeahead tests', function () {
7070
this.message = function () {
7171
return 'Expected "' + angular.mock.dump(typeaheadEl) + '" to be closed.';
7272
};
73-
return typeaheadEl.length === 0;
73+
return typeaheadEl.hasClass('ng-hide') === true;
7474

7575
}, toBeOpenWithActive: function (noOfMatches, activeIdx) {
7676

@@ -80,7 +80,7 @@ describe('typeahead tests', function () {
8080
this.message = function () {
8181
return 'Expected "' + this.actual + '" to be opened.';
8282
};
83-
return typeaheadEl.length === 1 && liEls.length === noOfMatches && $(liEls[activeIdx]).hasClass('active');
83+
return typeaheadEl.length === 1 && typeaheadEl.hasClass('ng-hide') === false && liEls.length === noOfMatches && $(liEls[activeIdx]).hasClass('active');
8484
}
8585
});
8686
});
@@ -670,4 +670,4 @@ describe('typeahead tests', function () {
670670
});
671671
});
672672

673-
});
673+
});

Diff for: template/typeahead/typeahead-popup.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<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()}}">
1+
<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()}}">
22
<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}}">
33
<div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>
44
</li>
5-
</ul>
5+
</ul>

0 commit comments

Comments
 (0)