From efb5212fcde391fe967e44f1c682f2daae9cffcf Mon Sep 17 00:00:00 2001 From: SimeonC Date: Fri, 15 Sep 2017 12:01:02 +0900 Subject: [PATCH] =?UTF-8?q?fix(Resize):=20Resize=20event=20didn=E2=80=99t?= =?UTF-8?q?=20trigger=20on=20scroll=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Watching for the window resize event meant that when you close a lightbox the width would not be calculated correctly leading to incorrect wrapping. --- src/Gallery.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Gallery.js b/src/Gallery.js index 4fcc62d..2af9992 100644 --- a/src/Gallery.js +++ b/src/Gallery.js @@ -27,7 +27,6 @@ class Gallery extends Component { componentDidMount () { this.onResize(); - window.addEventListener('resize', this.onResize); } componentWillReceiveProps (np) { @@ -250,9 +249,19 @@ class Gallery extends Component { tileViewportStyle={this.props.tileViewportStyle} thumbnailStyle={this.props.thumbnailStyle} />;}); - + var resizeIframeStyles = { + height: 0, + margin: 0, + padding: 0, + overflow: "hidden", + borderWidth: 0, + position: "fixed", + backgroundColor: "transparent", + width: "100%" + }; return (
this._gallery = c}> +