From 6a275b88e78441db91acc6edb432d57388584247 Mon Sep 17 00:00:00 2001 From: Malte W Date: Fri, 7 Aug 2015 17:44:34 +0200 Subject: [PATCH] fixed resize bug --- src/Scrollbars.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Scrollbars.js b/src/Scrollbars.js index 81a270fd..2d83f4bd 100644 --- a/src/Scrollbars.js +++ b/src/Scrollbars.js @@ -165,8 +165,8 @@ export default class Scrollbars extends Component { getSize() { const $el = findDOMNode(this); return { - width: $el.offsetWidth + SCROLLBAR_WIDTH, - height: $el.offsetHeight + SCROLLBAR_WIDTH + width: $el.offsetWidth + SCROLLBAR_WIDTH + 1, + height: $el.offsetHeight + SCROLLBAR_WIDTH + 1 }; } @@ -259,7 +259,8 @@ export default class Scrollbars extends Component { } handleWindowResize() { - this.update(); + const { width, height } = this.getSize(); + this.setState({ width, height }, this.update); } dragStart(event) {