Skip to content

Commit

Permalink
Merge pull request #174 from femioladeji/fix-ssr-flickering
Browse files Browse the repository at this point in the history
fix bug with ssr flickering
  • Loading branch information
femioladeji authored May 8, 2022
2 parents c259848 + c512ff4 commit 0004e85
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-slideshow-image",
"version": "3.7.3",
"version": "3.7.4",
"author": "Femi Oladeji",
"description": "An image slideshow with react",
"files": [
Expand Down
40 changes: 26 additions & 14 deletions src/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-ms-flex-align: center;
align-items: center;
}

.react-slideshow-container .nav {
Expand All @@ -24,11 +24,11 @@
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}

.react-slideshow-container .default-nav:hover,
Expand All @@ -48,21 +48,19 @@
border-top: none;
}


.react-slideshow-container .default-nav:last-of-type {
margin-left: -30px;
}


.react-slideshow-container + ul.indicators {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-top: 20px;
}

Expand Down Expand Up @@ -112,14 +110,20 @@
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
flex-wrap: wrap;
}

.react-slideshow-fade-wrapper .react-slideshow-fade-images-wrap > div {
position: relative;
opacity: 0;
}

.react-slideshow-wrapper
.react-slideshow-fade-images-wrap
> div[aria-hidden='true'] {
visibility: hidden;
}

.react-slideshow-wrapper.slide {
width: 100%;
overflow: hidden;
Expand All @@ -130,7 +134,11 @@
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
flex-wrap: wrap;
}

.react-slideshow-wrapper .images-wrap > div[aria-hidden='true'] {
visibility: hidden;
}

.react-slideshow-zoom-wrapper {
Expand All @@ -143,7 +151,7 @@
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
flex-wrap: wrap;
overflow: hidden;
}

Expand All @@ -153,3 +161,7 @@
display: -ms-flexbox;
display: flex;
}

.react-slideshow-zoom-wrapper .zoom-wrapper > div[aria-hidden='true'] {
visibility: hidden;
}
1 change: 1 addition & 0 deletions src/fade.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class Fade extends Component {
if (eachDiv) {
eachDiv.style.width = `${this.width}px`;
eachDiv.style.left = `${index * -this.width}px`;
eachDiv.style.visibility = `visible`;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class Slideshow extends Component {
applySlideStyle() {
this.allImages.forEach((eachImage, index) => {
eachImage.style.width = `${this.width}px`;
eachImage.style.visibility = `visible`;
});
}

Expand Down
1 change: 1 addition & 0 deletions src/zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class Zoom extends Component {
if (eachDiv) {
eachDiv.style.width = `${this.width}px`;
eachDiv.style.left = `${index * -this.width}px`;
eachDiv.style.visibility = `visible`;
}
}
}
Expand Down

0 comments on commit 0004e85

Please sign in to comment.