Skip to content

Commit

Permalink
use scrollTop for forcing reflow. (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
valdrinkoshi authored Jul 7, 2016
1 parent 0fa35a0 commit 48ef20f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions iron-collapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
/**
* `maxWidth` or `maxHeight`.
* @private
*/
*/
get _dimensionMax() {
return this.horizontal ? 'maxWidth' : 'maxHeight';
},
Expand Down Expand Up @@ -178,7 +178,7 @@
* Updates the size of the element.
* @param {string} size The new value for `maxWidth`/`maxHeight` as css property value, usually `auto` or `0px`.
* @param {boolean=} animated if `true` updates the size with an animation, otherwise without.
*/
*/
updateSize: function(size, animated) {
// No change!
var curSize = this.style[this._dimensionMax];
Expand All @@ -199,9 +199,9 @@
}
// Go to startSize without animation.
this.style[this._dimensionMax] = startSize;
// Force layout to ensure transition will go. Set offsetHeight to itself
// Force layout to ensure transition will go. Set scrollTop to itself
// so that compilers won't remove it.
this.offsetHeight = this.offsetHeight;
this.scrollTop = this.scrollTop;
// Enable animation.
this._updateTransition(true);
}
Expand Down

0 comments on commit 48ef20f

Please sign in to comment.