Skip to content

Commit

Permalink
Andrew s/neg vt issue (#30)
Browse files Browse the repository at this point in the history
* Fixes for neg VT

* Update isHidden

* Cleanup

* Remove log

* Update call
  • Loading branch information
andrew-sotiriou committed May 27, 2022
1 parent 07221f8 commit 4278140
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Bling.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,13 @@ class Bling extends Component {
slotSize,
this.viewableThreshold
);
if (inViewport) {

const isHidden = () => {
const el = ReactDOM.findDOMNode(this);
return el.offsetParent === null || el.style.display === "none";
};

if (inViewport && !isHidden()) {
this.setState({inViewport: true});
}
}
Expand Down

0 comments on commit 4278140

Please sign in to comment.