From cbe483f725e3de91d5b4c5e0bc26b5f4d11a3999 Mon Sep 17 00:00:00 2001 From: xobotyi Date: Mon, 19 Nov 2018 15:56:24 +0300 Subject: [PATCH] fix for undefined value situations; --- dist/index.js | 4 ++-- src/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index de564d9..7f102ef 100644 --- a/dist/index.js +++ b/dist/index.js @@ -304,11 +304,11 @@ function (_React$Component) { } if (this.props.scrollTop !== prevProps.scrollTop) { - this.contentEl.scrollTop = this.props.scrollTop; + this.contentEl.scrollTop = this.props.scrollTop || 0; } if (this.props.scrollLeft !== prevProps.scrollLeft) { - this.contentEl.scrollLeft = this.props.scrollLeft; + this.contentEl.scrollLeft = this.props.scrollLeft || 0; } } }, { diff --git a/src/index.js b/src/index.js index bcf379b..b728b09 100644 --- a/src/index.js +++ b/src/index.js @@ -237,11 +237,11 @@ export default class Scrollbar extends React.Component { } if (this.props.scrollTop !== prevProps.scrollTop) { - this.contentEl.scrollTop = this.props.scrollTop; + this.contentEl.scrollTop = this.props.scrollTop || 0; } if (this.props.scrollLeft !== prevProps.scrollLeft) { - this.contentEl.scrollLeft = this.props.scrollLeft; + this.contentEl.scrollLeft = this.props.scrollLeft || 0; } }