Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(typeahead): replace ng-if with ng-show in matches popup
Browse files Browse the repository at this point in the history
Fixes #2474
Fixes #2541
Fixes #2293
Closes #2535
Closes #2557
  • Loading branch information
zackarychapple authored and pkozlowski-opensource committed Aug 15, 2014
1 parent e793c37 commit a0be450
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>

4 comments on commit a0be450

@zakhenry
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the timeline for this fix being released into angular-ui/bootstrap-bower? Is this project intending to do patch releases like 0.11.1?

Thanks 👍

@xieranmaya
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anyone ran into this issue, only change the ng-if to ng-show in ui-bootstrap-tpls-0.11.0.js file's last will make it work in ng-1.3.x-beta

@porjo
Copy link

@porjo porjo commented on a0be450 Sep 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiphiaz my thoughts exactly!

I just came here looking to see why my Bower angular-ui was still broken, saying to myself "I'm sure this was fixed ages ago!?"

@xfalcox
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, please create a release 0.11.1 on angular-ui/bootstrap-bower.

Please sign in to comment.