From 48ef20f4c2e8e24338c1ddf057bf564ece944d7a Mon Sep 17 00:00:00 2001 From: Valdrin Koshi Date: Fri, 8 Jul 2016 00:05:27 +0200 Subject: [PATCH] use scrollTop for forcing reflow. (#59) --- iron-collapse.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iron-collapse.html b/iron-collapse.html index 800c380..a496d09 100644 --- a/iron-collapse.html +++ b/iron-collapse.html @@ -129,7 +129,7 @@ /** * `maxWidth` or `maxHeight`. * @private - */ + */ get _dimensionMax() { return this.horizontal ? 'maxWidth' : 'maxHeight'; }, @@ -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]; @@ -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); }