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

Collapse fails to update its height when toggling collapse model #2836

Closed
mxth opened this issue Oct 15, 2014 · 2 comments
Closed

Collapse fails to update its height when toggling collapse model #2836

mxth opened this issue Oct 15, 2014 · 2 comments

Comments

@mxth
Copy link

mxth commented Oct 15, 2014

I have a simple collapse.

<ul collapse="isCollapsed">
  <li ng-repeat="item in items">
    {{item}}
  </li>
</ul>

Here is the controller:

angular.module('ui.bootstrap.demo').controller('CollapseDemoCtrl', function ($scope) {
  $scope.isCollapsed = true;
  $scope.items = [];
  $scope.add = function() {
    $scope.items.push(Math.random());
  }
});

Plunker: http://plnkr.co/edit/ZYE3A4gt2I3JZgOEXxhf?p=preview

When I toggle the isCollapsed from true to false and add more items to the list, the collapse height is not updated.

The problem is when toggling isCollapsed from true to false, if the list has no item (height: 0px), the collapse will not set the height attribute to auto. Thus, it will make the collapse fail to update its height.

It does not happen when isCollapsed is initialized with false value (still with empty list), since the height attribute is auto in this case.

@rllola
Copy link

rllola commented Jan 21, 2015

I have the same issue.
Does the fix has been commited in the master branch ?
I have Angular 1.2.26 an bootstrap UI 0.12.0

Thank you

@chrisirhc
Copy link
Contributor

Will be fixed via #1444

@chrisirhc chrisirhc self-assigned this Mar 23, 2015
@chrisirhc chrisirhc added this to the 0.13.0 milestone Mar 23, 2015
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Mar 23, 2015
- Animations are now opt-in, include ngAnimate to see collapse
  animations

- ngAnimate handles initial state and doesn't animate if first
  reflow hasn't occurred.
  angular/angular.js@cc58460

- Tests may need more work. Right now they test for 'in' class.

Fixes angular-ui#1774
Fixes angular-ui#2821
Fixes angular-ui#2836
Closes angular-ui#1274
Closes angular-ui#1444
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Mar 23, 2015
- Animations are now opt-in, include ngAnimate to see collapse
  animations

- ngAnimate handles initial state and doesn't animate if first
  reflow hasn't occurred.
  angular/angular.js@cc58460

- Tests may need more work. Right now they test for 'in' class.

Fixes angular-ui#1774
Fixes angular-ui#2821
Fixes angular-ui#2836
Closes angular-ui#1274
Closes angular-ui#1444
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Mar 23, 2015
- Animations are now opt-in, include ngAnimate to see collapse
  animations

- ngAnimate handles initial state and doesn't animate if first
  reflow hasn't occurred.
  angular/angular.js@cc58460

- Tests may need more work. Right now they test for 'in' class.

Fixes angular-ui#1774
Fixes angular-ui#2821
Fixes angular-ui#2836
Closes angular-ui#1274
Closes angular-ui#1444
ayakovlevgh pushed a commit to ayakovlevgh/bootstrap that referenced this issue Mar 24, 2015
- Animations are now opt-in, include ngAnimate to see collapse
  animations

- ngAnimate handles initial state and doesn't animate if first
  reflow hasn't occurred.
  angular/angular.js@cc58460

- Tests may need more work. Right now they test for 'in' class.

Fixes angular-ui#1774
Fixes angular-ui#2821
Fixes angular-ui#2836
Closes angular-ui#1274
Closes angular-ui#1444
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants